Daniel Oliveira
Daniel Oliveira

Reputation: 9003

Dart: Snapshots vs AOT

I am searching a lot about this great language and got myself on this page https://github.com/dart-lang/sdk/wiki/Snapshots but it didn't answer some questions:

Upvotes: 7

Views: 1583

Answers (1)

Tidder
Tidder

Reputation: 1214

  • With snapshots, nothing of your code (kernel snapshots) or only portions of your code (JIT snapshots) are pre-compiled into binary format. With AOT, all of your code gets pre-compiled to binary (platform specific) format. Pre-compiled binary code (AOT) is faster, because there is no need to compile code at runtime.
  • As mentioned above, AOT compiled code is transformed to platform specific binary code. Therefor you can not run a program AOT compiled for Windows on a Linux machine. With kernel snapshots, nothing of your code is pre-compiled. So it is portable between platforms, but must be compiled at runtime. So yes, this is slower.
  • Also as mentioned above, with kernel snapshots nothing of your code gets pre-compiled. With JIT snapshots, the program is executed in a test run and each part of the code that is executed, gets pre-compiled to platform specific binary format. So JIT snapshots is faster then kernel snapshots.

Upvotes: 9

Related Questions