Re:Dart2js is faster than V8 in DeltaBlue test
by drostie on Thursday March 21, 2013 @08:38AM
(#5414576)
Right, they're basically saying that v8(dart2js(code)) is faster than v8(transliterate(code)), i.e. that dart2js is becoming better at optimizing the code for V8 than V8 is by itself.
Re:Dart2js is faster than V8 in DeltaBlue test
by ZeroGravitas on Thursday March 21, 2013 @09:26AM
(#5414824)
isn't it v8(dart2js(dart_code)) vs v8(js_code)
So there could be some difference between the original code in both, and some benefit from compiling to js (e.g. they could use crazy tricks similar to asm.js to generate faster code perhaps based on type hints present in Dart but not the JS)
Re:Dart2js is faster than V8 in DeltaBlue test
by hmottestad on Thursday March 21, 2013 @09:12AM
(#5414750)
Which shouldn't really come as much of a surprise since dart is a higher-level language. That way the higher-level code can be optimised, and then the output JS can be optimised.
Re:Dart2js is faster than V8 in DeltaBlue test
by lvivski on Thursday March 21, 2013 @09:50AM
(#5414975)
It's more like "Handwritten Javascript vs Dart2JS generated Javascript" and the latter is better optimized
Re:Dart2js is faster than V8 in DeltaBlue test
by emn13 on Thursday March 21, 2013 @01:29PM
(#5417068)
Yeah, and in that sense it's unsurprising - witness how v8 is still typically much, much slower than native C - but emscriptem does surprisingly well.
Essentially, no human word use unhandy, verbose, hard to read syntax whereas a compiler might. Thus in practice the JS subset that handwritten code uses is different from that of compiler generated code.
Similarly, the dart2js numbers are generated by compiling the benchmarks and harness to JavaScript and then running the generated code in V8.
Finally, the V8 numbers are generated using the same benchmarks written in JavaScript and with exactly the same harness rewritten in JavaScript.
From what I'm reading, this appears to suggest that Dart2js isn't faster than V8, but is instead faster than a handwritten code. Still a good achievement!
The reason I bring this up is because I was confused at how javascript (even compiled from Dart) could be faster than the engine that is running it.