RE: Minimizing dots for accessing properties
"Lon Boonen" <[email protected]> Tue, 23 May 2006 09:58:55 +0200
| Newsgroups | gmane.comp.web.dom.wdf |
|---|---|
| Message-ID | <[email protected]> |
Hi Mandy,
Think.
And try.
Try to think.
It takes only a bit of understanding to reason this.
It takes only a few lines to test this.
Those lines are:
var t0 = +new Date();
for (var i=0; i<10000; i++)
Mandy.util.Error.test();
var t1 = +new Date();
var Error = Many.util.Error;
var t2 = +new Date();
for (var i=0; i<10000; i++)
Error.test();
var t3 = +new Date();
alert("Logic dictates that " + (t3-t2) + " < " + (t1-t0) + ",
but very probably only marginally so. Very much depending on the number
of members of Mandy and/or util.");
groetjes Lon
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Maninder, Singh
> Sent: dinsdag 23 mei 2006 9:41
> To: [email protected]
> Subject: RE: [wdf-dom] Minimizing dots for accessing properties
>
> Would it be better if I cached the object?
>
> eg:
>
> var E = Mandy.util.Error;
> E.test();
> E.test2();
> E.test3();
>
>
> Instead of
>
> Mandy.util.Error.test();
> Mandy.util.Error.test1();
> Mandy.util.Error.test2();
>
> Thanks,
> Mandy.
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> Get to your groups with one click. Know instantly when new
> email arrives
> http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/9rHolB/TM
> --------------------------------------------------------------
> ------~->
>
> Unsubscribe
> [email protected]
>
> List info
> http://www.quirksmode.org/dom/list.html
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
You can search right from your browser? It's easy and it's free. See how.
http://us.click.yahoo.com/_7bhrC/NGxNAA/yQLSAA/9rHolB/TM
--------------------------------------------------------------------~->
Unsubscribe
[email protected]
List info
http://www.quirksmode.org/dom/list.html
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wdf-dom/
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/