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.
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.
- Database Administration Tutorials
- Programming Tutorials & IT News
- Linux & DevOps World
- Ebook Reviews
- PES Matches, Skills & News