Flashforward a few months later and Oracle open sourced the project GraalVM. The project quickly got my attention and intrigued me with it’s Polyglot aspect. After going through the docs it became obvious that ES4X should have support for this.
I was faced with the decision:
- (A) Abandon all the current
[Open|Oracle]JDKusers in favour of
- (B) Try to get it working on both
As a developer I like a good challenge, so I went with option
B. After many commits and rollbacks I believe the project got some simple abstractions that allow both:
JDK >=8 and
GraalVM to run the same code without the need of recompilation, a true, write once run everywhere if I may.
Of course this didn’t come out with out many support questions to the very friendly and helpful Graal team.
So we’re now at
release candidate 5 and all the issues I’ve reported and asked have been fixed and I am happy to announce that we can run ES4X Vert.x application on Graal without issues. In order to verify that things are fine I’ve implemented the Techempower Web Framework Benchmark to see if Graal and ES4X would live to the expectations. Many said that Graal was fast but we always need to double check ;-)
In order to quickly compare how things work I’ve took the current
nodejs implementation AS IS and run the benchmark:
- For details on the tests see the techempower site.
And then I’ve implemented the ES4X version of the benchmark. You will have to note that in this implementation there are no trickery to make things go faster, for example we do parse the full request and not have a hack to extract parameters from the request path; we use the
When the implementation above is run I’ve got:
Notes: The start command for this run was:
~/graalvm-ce-1.0.0-rc5/bin/java \ -server \ -XX:+UseNUMA \ -XX:+UseParallelGC \ -XX:+AggressiveOpts \ -Dvertx.disableMetrics=true \ -Dvertx.disableH2c=true \ -Dvertx.disableWebsockets=true \ -Dvertx.flashPolicyHandler=false \ -Dvertx.threadChecks=false \ -Dvertx.disableContextTimings=true \ -Dvertx.disableTCCL=true \ -jar \ target/techempower-benchmark-1.0.0-fat.jar \ --instances \ `grep --count ^processor /proc/cpuinfo`
These results are amazing, it shows that running your server side code with vert.x and ES4X will give you at least 157% performance boost, up to 708%. The only test that was worse was the
fortune test, and, as explained this is due to the fact that currently the generated API is not the best.
Here are the final results as
ES4X / NodeJS: