3 ms·
From this page: Similarly, the dart2js numbers are generated by compiling the benchmarks and harness to JavaScript and then running the generated code in V8.
by testing12341234 14y ago
From this page:
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.
- drostie 14y agoRight, 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.
- hmottestad 14y agoWhich 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.
- ZeroGravitas 14y agoisn'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)
- lvivski 14y agoIt's more like "Handwritten Javascript vs Dart2JS generated Javascript" and the latter is better optimized
- emn13 14y agoYeah, 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.