I doubt there is any measurable performance advantage. After the entire chain of scopes is checked for the identifier windowfirst, then the window object will be scanned for the desired element. Therefore, it is more likely that this will constrain performance.
Using a window prefix is useful if you have another variable in scope that will hide an element that you might want to extract from the window. The question is, can you always know when it can be? The answer is no. So you should always prefix with a window? What would you look like if you did. Ugly. Therefore, do not do this if you do not know what you need.
source
share