[jQuery] Re: about "speed up references to window"

2009-01-07 Thread Jinpu Hu
search window in global scope is slower than search window in local scope On Jan 8, 9:50 am, Jinpu Hu wrote: > oh,thank you > i see > > On Jan 8, 9:25 am, Ricardo Tomasi wrote: > > > It has to be a local var: > > > (function(){ > > var window = this; > > > })(); > > > On Jan 7, 11:17 am, Jinpu

[jQuery] Re: about "speed up references to window"

2009-01-07 Thread Jinpu Hu
oh,thank you i see On Jan 8, 9:25 am, Ricardo Tomasi wrote: > It has to be a local var: > > (function(){ > var window = this; > > })(); > > On Jan 7, 11:17 am, Jinpu Hu wrote: > > > I see "var window = this" from latest svn code > > > I use firebug debugger it. > > > info:"Exception: redeclarat

[jQuery] Re: about "speed up references to window"

2009-01-07 Thread Ricardo Tomasi
It has to be a local var: (function(){ var window = this; })(); On Jan 7, 11:17 am, Jinpu Hu wrote: > I see "var window = this" from latest svn code > > I use firebug debugger it. > > info:"Exception: redeclaration of const window" > > but in core.js > > var >         // Will speed up reference

[jQuery] Re: about "speed up references to window"

2009-01-07 Thread Balazs Endresz
Using myvar==undefined (or any variable, which is undefined) is about 30% faster than typeof myvar=="undefined" About window, I don't know if that would speed up accessing it but being a local variable it may be a bit faster. I think the main purpose is to allow some minifiers to replace local va