Why Flutter is so slow in debug mode?

Emre Şurk
1 min readSep 10, 2023

--

a schema to show JIT is being used in development, AOT is being user in deployment.

Because it makes you faster as a developer.

Computer codes are compiled in two ways;

JIT

Just-in-time compilation, deliver a half-compiled code to the client, the client compiles the rest as it is being used.

Pros

Lots of flexibility.
Java, Kotlin, C#, Python, Dart, etc., all use this method.

Cons

Terrible performance. It's okay if you do server things[1], but for mobile, a clear no.

AOT

Pros

Awesome performance.
Assembly, Swift, C, C++, and Dart use this method.

Cons

You need to target the platform perfectly while you compiling your code.

As you see, Dart using both. Dart uses JIT while in debug mode to support hot reload(code push), and uses AOT while in release mode to serve high performance.

What a beautiful language. (Except when you use it in the web frontend and it compiles itself to JS and the debugger begins to hate me.)

You can see the difference clearly when you switch the compiling mode.

That’s all.

[1]: Stop talking about the performance of the language: It's not important.

--

--

No responses yet