다트
AOT | JIT |
---|---|
– Class loading prevents method inlining | + Can use aggressive method inlining |
– No runtime bytecode generation | + Can use runtime bytecode generation |
– Reflection is complicated | + Reflection is (relatively) simple |
– Unable to use speculative optimizations | + Can use speculative optimizations |
– Overall performance will typically be lower | + Overall performance will typically be higher |
+ Full speed from the start | – Requires warmup time |
+ No CPU overhead to compile code at runtime | – CPU overhead to compile code at runtime |
var name = 'hi';
name = 'bye';
name = 1; // compilation failed
dynamic age = 1;
age = '초등학교 5학년'; // success
final String name = 'hi';
name = 'bye'; // error
name = 'hi'; // error
const String name = 'hi';
name = 'bye'; // error
name = 'hi'; // error