Actually, no leaks at all, almost the same elapsed time, and weird enough
apparently leaks are with Firefox and expando integer.
This is the test I have used, please note it could be stressful via Firefox:
onload = function(){
alert("snap"); // use alert/snaps to monitor memory usage via task
manager
for(var i = 0, body = document.body, t = new Date, div; i < 20000; ++i){
div = body.appendChild(document.createElement("div"));
div.expando = new Number(i);
};
alert(new Date - t);
div = i = null;
t = new Date;
body.innerHTML = "";
alert(new Date - t);
for(var i = 0, body = document.body, t = new Date, div; i < 20000; ++i){
div = body.appendChild(document.createElement("div"));
div.expando = i;
};
alert(new Date - t);
div = i = null;
t = new Date;
body.innerHTML = "";
alert(new Date - t);
};
Regards
On Sat, Oct 17, 2009 at 5:48 PM, Andrea Giammarchi <
[email protected]> wrote:
> expando is removed when necessary while new Number is an instance of Object
> but basically just an integer, I can't spot side effects here but if you
> have a test about this I'll have a look.
>
>
> On Sat, Oct 17, 2009 at 3:31 PM, Dave Methvin <[email protected]>wrote:
>
>>
>> > #38 elem[ expando ] = new Number(id);
>>
>> I thought there were memory leaks when attaching Javascript objects to
>> DOM expandos in IE.
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---