|Posted by:||Randy Webb (hikksnotatho…@aol.com)|
|Date:||Tue, 20 Nov 2007|
Sampat said the following on 11/20/2007 6:24 PM:
> I wanted to know the performance of calling a function pointer v/s a
> multiple calls in the js to the same function. Please share your
> thoughts if someone has worked on this.
You don't need testing to figure it out, although testing will prove it.
The function pointer is *always* going to be slower. It has to be slower
since it it doing more than a plain function call. You are telling the
browser "Do this, then do that" versus "do that" and the first will
*always* be slower.