4 ms·
Interesting post. Seems similar to the approach of HPHPC for PHP, where the code is first run offline in a simulated environment to collect type information, an
by sillycross 5y ago
Interesting post. Seems similar to the approach of HPHPC for PHP, where the code is first run offline in a simulated environment to collect type information, and then use these speculations to generate static-typed code ahead-of-time.
Would be interested to see a performance comparison with V8 JIT (instead of V8 interpreter).
- divs1210 5y agoAFAIK Graal native-image also does something similar.
- chrisseaton 5y agoFor Java, yes. They're working on JavaScript and Ruby etc, but not sure it's quite there yet.
- kaba0 5y agoThey already have GraalJS which is afaik up-to-date with the EcmaScript spec and has insane throughput (on long-running tasks it has comparable speed to V8, with a much much smaller team behind it) - it can AOT compile said code as well, but I’m not sure about the performance characteristics of that.
- sillycross 5y agoJava is static-typed already and only has a low degree of dynamism, so the importance of doing so is much less (only to reduce the initialization time I believe).
- chrisseaton 5y agoThere's a lot of interfaces and virtual calls in Java. Not sure if you're considering that dynamic or not, but I would would. Graal does some pretty intense whole-universe points-to analysis which enables monomorphisation, devirtualisation, scalar replacement, etc.
- CountHackulus 5y agoJava is yes, but the JVM runs other things and things like JRuby use the JVM bytecode for invoke_dynamic. There were a few things rewritten to use that bytecode from what I remember but it's been a while since I've worked in that area.