At the last meeting I mentioned that I was worried about the performance of the getprop operation when calling global functions (such as in fib). Probably the biggest performance "mountain" at this point. So I wrote a simple benchmark to test how Tachyon performs when calling global functions:
function f0() { } function f1() { f0(); f0(); f0(); f0(); } function f2() { f1(); f1(); f1(); f1(); } function f3() { f2(); f2(); f2(); f2(); } function f4() { f3(); f3(); f3(); f3(); } function f5() { f4(); f4(); f4(); f4(); } function f6() { f5(); f5(); f5(); f5(); } function f7() { f6(); f6(); f6(); f6(); } function f8() { f7(); f7(); f7(); f7(); } function f9() { f8(); f8(); f8(); f8(); } function f10() { f9(); f9(); f9(); f9(); } function f11() { f10(); f10(); f10(); f10(); } function f12() { f11(); f11(); f11(); f11(); } function f13() { f12(); f12(); f12(); f12(); } function f14() { f13(); f13(); f13(); f13(); } function f15() { f14(); f14(); f14(); f14(); } f15();
That code only does function calls, there is no arithmetic or loops. So the performance should be directly linked to the cost of calling global functions. Here are the running times for Tachyon and other JS VMs (relative times in parentheses):
V8 1.700s ( 1.0) Safari (WebKit) 8.753s ( 5.1) Firefox (SpiderMonkey) 10.354s ( 6.1) Tachyon 111.240s (65.4)
Two things come to mind:
- V8 is really doing well compared to the other commercial JS VMs - Tachyon is doing really poorly, it is an order of magnitude slower than commercial JS VMs and almost two orders of magnitude slower than V8
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.
In any case, I think this shows clearly that Tachyon's mechanism for calling global functions is particularly inefficient. We need to fix that!
Marc