Filip Hráček /
Flutter performance /
Flutter Performance Book
Hi, I’m Filip. I worked on the Dart and Flutter teams at Google between 2016 and 2021, and I've been involved in Flutter performance, specifically, for over 7 years now. I've helped a few Flutter startups from performance-related trouble, and I've done more than my share of education and outreach.
You may recognize my face from the official Flutter YouTube channel. Some of the veterans of Flutter development might remember my Flutter performance talk at Flutter Europe 2020 or maybe they've read my old Medium.com articles on performance testing and raster thread optimization.
Here, I plan to put together a more coherent story of how to build performant Flutter apps and games. While most developers are probably fine knowing a few tips and tricks here and there — and can still deliver performant apps — I believe there’s a need for a subset of Flutter developers who become performance experts. Every organization using Flutter would benefit from a Winston Wolfe that knows what to do when things get slow or inefficient.
That could be you. Performance optimization is a vast and complicated topic but it’s learnable and — dare I say — fun.
Chapters
I’m writing the book in the open so that I can get feedback (email me, message me, or discuss). Here’s a very rough outline. Chapters that are drafted already are linked.
- Intro
- Performance, speed, efficiency
- Is Dart fast enough?
- Amdahl’s law
- Performance lottery
- Environment
- Performance profiling vs analysis vs benchmarking vs testing
- Benchmarking - Easy mode %% What is benchmarking for? tight loop/hot path. Remember: it’s tooling from the days of batch programs -- it may not be important; code locality is high, though — 80% of total execution is covered by 50 to 150 functions (JSMeter 2009). Easy mode: C++, batch, min(values). Only if you don’t allocate, or don’t care. ; maybe look at claim from https://medium.com/@chetan.akarte/what-is-symbol-in-dart-4483b2f7f5d6 - Symbols faster? actually no. despite that, LLMs recommend it https://kagi.com/assistant/92a6d6ff-fcef-41d4-b0e5-21a16ef7a661, run longer work rather than repeat something short. If it’s really short, it probably doesn’t matter. If it happens in a tight loop, measure the thing that runs the loop.%%
- Statistics for performance engineers
- Benchmarking - Normal mode
- Data visualizations for performance engineers
- Benchmarking - Hard mode
- Benchmarking - Nightmare mode
- CPU Profiling (
time -v
, flame chart, perf
, simpleperf
)
- Timeline
- Raster thread optimization
- Memory (caching, memory pressure, memory leaks, GC, GC jank, WeakReference)
- Data structures (TypedData, Buffers, “Efficiency with Algorithms, Performance with Data Structures”)
- FFI
- Parallelism & Concurrency (Futures, async/await, isolates, “Dart is not multithreaded”,
pragma(“vm:shared”)
)
- Pragmas
- Inlining
- Understanding Dart Kernel Representation
- SIMD / vectorization
- Interop with the platform (the other side of method channels, FFI)
- Continuous performance testing
- Sleights of hand (perceived performance magic tricks)
- A bag of tricks
No guarantees the book will ever be finished but if you want to be notified, subscribe to my mailing list.
(back to index)