22

My understanding is that Flutter is compiled AOT. Can it be compiled as JIT instead of AOT, will it work and what is the switch that would do that?

Thanks!

2
  • @RubensMelo so in theory I should be able to use dart:mirrors to get reflection on Flutter objects. Or is there some other issue.
    – user603749
    Apr 26, 2019 at 0:04
  • Sure. You can use it. Apr 26, 2019 at 1:37

3 Answers 3

66

In development mode, Flutter is compiled just-in-time. That is why we can do hot-reload/restart so fast. In release mode (when you go to publish your app), your code is compiled ahead-of-time, to native code. It is for better performace, minimum size and remove other stuff that are useful in dev mode.

2
  • 1
    Do you mean JIT works in debug mode and AOT works in release and profile mode right?
    – Balaji
    Nov 7, 2022 at 9:27
  • 1
    Yes default is debug -> JIT , release & profile -> AOT Sep 20 at 18:49
7

As per resource, I got the following points :

1) The Dart code is ahead-of-time (AOT) compiled into a native, ARM library.

2) When launched, the app loads the Flutter library. Any rendering, input or event handling, and so on, are delegated to the compiled Flutter and app code.

0

There is a JIT release mode with restrictions (iOs):

https://github.com/flutter/flutter/wiki/JIT-Release-Modes

So the answer is ~yes

And the build mode is the switch, but you can control it (in one direction).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.