V8 is really doing well compared to the other commercial JS VMs
V8 started out as a pure JIT, and probably has a more solid design and optimization pipeline than the other two, which started out as bytecode interpreters, and eventually had a JIT compiler tacked on top... Which still optimizes and compiles bytecode.
This is surprising because on large JS benchmarks (such as the Tachyon compiler), the performance difference is not so great (Tachyon is "only" 10 times slower than V8), and on fib, Tachyon is 4 times slower than V8.
Not so surprising. The Tachyon functions do actual work. Some of them can execute for a while. This microbenchmark only has function calls. So you're testing the thing we perform worst on.
On a side note. We know fetching from the global object is slow, but I wonder how slow function calls themselves are. We could get a bit of an idea by calling nested functions (closures) repeatedly. Those functions won't be fetched from an object, they're treated as local variables.
In any case, I think this shows clearly that Tachyon's mechanism for calling global functions is particularly inefficient. We need to fix that!
We will, and we'll improve the performance in several other areas as well. I'm confident we can improve the generated IR, improve the quality of our generated machine code on several levels, increase our level of JavaScript support and optimize global function calls before the end of the summer.
However, in the case of global function calls... I'd rather we not rush to implement this optimization in the backend in a tightly coupled way. In my opinion, we should first implement some generic code patching functionality in the IR and backend, which we can then use to implement this optimization as well as several others.
- Maxime