The company I work at bought us (or rather me) the jQuery Cookbook by O’Reilly which I am reading from front to back. Now I am at 5.13 which talks about Name Lookups. It claims that given the right circumstances, code which is optimized regarding Name Lookups can have an up to 70% performance boost. In one very situational example, it claims to be even 35x faster and cutting execution time from 7 seconds to a mere 0.2 seconds!
My Question is: By which factor does a Name Lookup Optimization enhance performance in a real live situation an is it worth the extra few hours on a 4k JS-lines AJAX Application?
The factor which it helps depends on how it is used really. Its like asking how long is a piece of string.
I have seen setting names for true,false, undefined can make an application at least 10x faster in the javascript. The reason why it become faster is that it doesn’t need to look inside the global scope chain. Nick Zakas explains it quite well in the video below from google code
http://googlecode.blogspot.com/2009/06/nicholas-c-zakas-speed-up-your.html
EDIT:
I just came across this and thought it may be useful. its a quick explanation of the scoping chain too. http://www.phpied.com/extreme-javascript-optimization/