posted on 2005-05-21
I just did some benchmarks for a fibonnacci(32) for some languages and different Neko runtimes, and here’s some comparisons (time in seconds) :
- ocaml bytecode : 0.42
- ocaml opt : 0.06
- java -Xint : 0.73
- java JIT : 0.11
- MTSVM : 2.03
- Python 2.4 : 5.83
- PHP 4.3.10 : 16.40
- neko interp : 16.08
- neko ocamlgen bytecode : 9.90
- neko ocamlgen opt : 0.65
- neko VM : 1.91
Theses times only mesure computation time and does not take into account VM startup or bytecode loading. I hope to get around a 10 factor improvment when adding JIT to Neko. That would bring us ahead of the Ocaml bytecode speed which is quite good for a dynamicly typed language with untrusted bytecode. Adding some primitives such as
$icompare for optimized integer operations might improve a lot also, but will only be available for high level staticly typed programming languages that generate to Neko.
posted on 2005-05-21
Recently there’s been an anouncement for an Open Source JVM sponsored by the Apache Foundation. The project is called Harmony. I’ve been following the mailing list, it’s interesting to see the founding of such an open source project, and the topic (high perf VM) is appealing. Just following the links posted on the list I could find a lot of JVMs that I didn’t know about and have a look at their source code.
That have inspired me to write the NekoVM, which is now almost complete as well as the corresponding compiler. I just need to add the exceptions and some missing primitives. It use the same architecture/technology that the MotionScriptVM I previously wrote, but performs more checks when loading the bytecode which enable :
- more aggresive optimizations, by inlining global or jump addresses directly into the code.
- module-independant code : since all addresses are staticly resolved at loading time, several modules can run and callback each other, which was not the case with MTSVM which needed an offline linking phase. This open the feature of dynloaded modules for Neko.
Next step is either to start NekoML (an ML compiler that generate to Neko) or to JIT to the NekoJM (using for example GNU Lightning Library).