4 ms·
[ disclaimer: I work on the Dart team ] It depends on how you run. Dart can either run in JIT mode or AOT mode. In general, when you ship a production app (e
by vsmenon 6y ago
[ disclaimer: I work on the Dart team ]
It depends on how you run. Dart can either run in JIT mode or AOT mode. In general, when you ship a production app (e.g., for Flutter), you are using AOT - i.e., it's compiling to native machine code. In this case, there is no interpretation or compilation at runtime. We still bundle a runtime for garbage collection.
- axaxs 6y agoWhich does 'compile exe' use? Essentially here is what I see - $ cat a.dart void main() { print("hello world"); } $ dart compile exe a.dart Info: Compiling with sound null safety Generated: /home/x/a.exe ~ $ strip a.exe ~ $ ./a.exe --version Dart SDK version: 2.12.0 (stable) (Thu Feb 25 19:50:53 2021 +0100) on "linux_x64" If I run without --version, it prints the same thing the 'dart' command does.
- vsmenon 6y agoThanks - not what I'd expect, but I can repro. Bug filed here: https://github.com/dart-lang/sdk/issues/45197 https://github.com/dart-lang/sdk/issues/45197 It is AOT though. If you time `dart a.dart` vs `./a.exe` (pre strip :-), the latter should be considerably faster.