Comparing PyPy and NodeJS (V8) using parser code generated by Waxeye
As an update to me previous post I have decided to create another “unscientific” benchmark.
This time I have compared Python and JavaScript parser generated by Waxeye using PyPy and NodeJS (V8).
In the first benchmark, all of the queries which were parsed by the parser were the same, but in this one, I have generated 100000 random queries where each one is composed of three to eight tokens with random values.
I was curious how PyPy and V8 JIT will perform in this case where different values are used in each iteration.
You can find the raw results on github, same goes for the Python and JavaScript test script source code.
# of iterations | CPython 2.6.6 (new style classes) | PyPy 1.5.0-alpha0 (new style classes) | NodeJS 3.0.2 (V8 3.0.3) |
---|---|---|---|
100000 | 100.382 seconds | 29.587 seconds | 9.661 seconds |
As you can see from the table above, JavaScript parser (NodeJS / V8) was a lot faster.
It looks like that V8 JIT did a lot better job in this case.
Also keep in mind that I haven’t touched and tried to optimize the main Waxeye parser code and the parser code generated by Waxeye.