Why Flutter application slow ?



When you're developing flutter application, you see that it's slow and have problems like blink when lanch and more, that because you're in debug mode.




In debug mode, the application has:

  • launch is slow
  • blink when launch
  • app size big.

because debug mode with Hot reloads. but when you create release apk https://flutter.io/docs/deployment/android ; you can find:

  • fast lunch
  • no blink when the launch
  • app size small (but bigger than the normal android app)


Debug mode enables additional checks (such as asserts) that don’t run in profile or release builds, and these checks can be expensive. Debug mode also executes code in a different way than release mode. The debug build compiles the Dart code “just in time” (JIT) as the app runs, but profile and release builds are pre-compiled to native instructions (also called “ahead of time”, or AOT) before the app is loaded into the device. JIT can cause the app to pause for JIT compilation, which itself can cause jank.
more: 

Debug mode on device (including simulators, emulators): Turns on all the assertions in the world, includes all debugging information, enables all the debugger aids (e.g. observatory) and service extensions. Optimizes for fast develop/run cycles. Does not optimize for execution speed, binary size, or deployment. Used by flutter run. Built with sky/tools/gn --android or sky/tools/gn --ios. Also sometimes called "checked mode" or "slow mode".


sources: link

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel