Reducing Javascript Function Call Overhead
<p>I have seen Javascript code that claims to speed up function call overhead like:</p>

<pre><code>function foo() {
  // do something
}

function myFunc() {
   var fastFoo = foo; // this caches function foo locally for faster lookups
   for (var i = 0; i &lt; 1000; i++) {
       fastFoo();
   }
}
</code></pre>

<p>I do not see how this can speed up javascript function call overhead, as it seems to me like it is just a memory lookup, either at the top of the current stack (for fastFoo) or somewhere else in the stack (I am not sure where the global context is stored... anyone?). </p>

<p>Is this a relic of ancient browsers, a complete myth, or a true improvement enhancer?</p>
