Why are .call and .apply slower than a direct function call in JavaScript?

Why are .call and .apply slower than a direct function call in JavaScript?

I’m curious about these jsperf results. They appear to demonstrate that a direct function call is substantially faster than the same function called with .call or .apply. (The difference between .call and .apply surprised me even more.) Could you please explain these results?
Update: Here is a jsperf that someone left that tests .apply without a second array instantiation.

Solutions/Answers:

Solution 1:

I guess the cause might depend on which interpreter your are running the code on, but it seems that normal functions calls are faster because the interpreter can use Inline Cache to access the properties.

You can have a look here for more information.

References

Related:  How to change onClick handler dynamically?