3 ms·
http://jsperf.com/dart-hello-world-test-with-optimize/5 http://jsperf.com/dart-hello-world-test-with-optimize/5 I moved things around so that what code does is
by swannodette 15y ago
http://jsperf.com/dart-hello-world-test-with-optimize/5 http://jsperf.com/dart-hello-world-test-with-optimize/5
I moved things around so that what code does is roughly equivalent. As you can see Dart is slower, but the Dart runtime does not differ by a margin that matters for many applications - and note the size of the gap differs significantly between JS engines.
- cdata 15y agoIn all fairness, you removed the actual print function from the code. Inspection of the non-compiled source suggests that the entire function execution as shown in /2 is called for every call to Dart's print. print$getter()(1, $noargs, 'Hello, Dart!'); print$getter()(1, $noargs, 'foo'); print$getter()(1, $noargs, 'bar');
- swannodette 15y agoI did not remove print. Google Closure Compiler does inlining as well.