3 ms·
o.f() and (0, o.f)() have different semantics - the latter is closer to temp = o.f; temp(). For that reason the optimisers see the code being function-call vs.
by olliej 12y ago
o.f() and (0, o.f)() have different semantics - the latter is closer to temp = o.f; temp().
For that reason the optimisers see the code being function-call vs. method-call. Given the usage of function and method calls are generally different the compilers make different optimising decisions.
- mraleph 12y agoYes, you are absolutely right - semantics is quite different. But that's not what changes perf here - the difference comes from whether there is an explicit property load or a property load is an implicit part of the method call. This change is also made in the code that never executes during the benchmark run - which adds to a conundrum. There is a very V8 / Crankshaft specific thing going on here - slides try to explain it.