Calling aliases and performance

I saw some discussions related to performance and it was brought up that using the "call" method is slow.

This jsperf was also linked: https://jsperf.com/function-calls-direct-vs-apply-vs-call-vs-bind/18

However, when I ran it, it seems like call was the fastest method when I ran it in chrome.

Testing in Chrome 46.0.2490.86 32-bit on Windows Server 2008 / Vista 64-bit
trvKSST.jpg
I don't know if this is only because chrome is super fast or something, but is `call` really a problem?
That's definitely interesting, my results look like this:


jsperf.png


(Chrome performance is slower, because i'm currently watching Netflix on it 😀 )


It seems like Chrome doesn't actually make a difference between call() and a direct function call, but in Firefox it makes a big difference.
.call() is good and I don't see any problem with it. And it solves many problems about scopes in JS.
That's definitely interesting, my results look like this:


attachicon.gif
jsperf.png


(Chrome performance is slower, because i'm currently watching Netflix on it 😀 )


It seems like Chrome doesn't actually make a difference between call() and a direct function call, but in Firefox it makes a big difference.
Oh ya, firefox just tanks in performance. 92% slower lol that's terrible...
doing .call and .apply is not slow. aliasing can become slow as you go from A -> B -> C -> D, assume that A is the parent function and B,C,D all alias it in separate scripts loading in sequential order. This will eventually lead to performance issues.

How ever if you really want the fastest way: use .apply(this, args) its not much faster but it a tad bit
apply() has been a lot slower than call() in all of our tests, so i really doubt that.
I thought .apply was the slowest option? It was when I ran that linked test.
Like i said in your feed, there are some people that are "performance freak" that cries about every milesecond lost.

I can't say for sure if .call is slow or not since i'm inexperienced in js. But what can I say until now is that i had no noticeable performance loss, and by noticeable i mean something that i don't need a software to show me.

And as an alias abuser, i really hope this never happens 😀
.call method is not slow at all.

Original thread: https://forums.rpgmakerweb.com/threads/calling-aliases-and-performance.51819/