3 ms·
One big advantage of top-level declarations is it is possible for the VM to use a snapshot for fast start up. This is not really possible if you must interpret
by xxgreg 13y ago
One big advantage of top-level declarations is it is possible for the VM to use a snapshot for fast start up.
This is not really possible if you must interpret top level code to build up your top-level declarations, as done in JS.
Using snapshots, the Dart authors have said it should be possible to improve script start up time by 10x over V8. This is a big win for large script heavy apps.
Edit: link https://www.dartlang.org/articles/snapshots/ https://www.dartlang.org/articles/snapshots/