Andreas Junghans wrote:
> Hi there,
>
> Am 01.12.2008 um 14:50 schrieb Matthew Gregory:
>
>> You could use "delete this.array" to free the memory instantly, it is
>> much slower than assigning it to null and waiting for the GC though.
>
> Sorry, but I don't think this is true. "delete this.array" simply
> removes the "array" key from the associative array that is referenced
> by "this". It doesn't really "delete" it (as there may be other
> references to the object), and it's certainly not slower than
> assigning it to null. (I suppose you didn't really test the
> performance of "delete". If you did, I'd be interested in the results.)
It was a while ago but I had one test something like this:
var myObj = {};
var i = 0;
function doIt()
{
myObj[i] = 4;
delete myObj[i];
i++;
}
window.setInterval("doIt()", 10);
and it ran 50 times a second with without eating any memory.
I then tried the same but used "myObj[i] = null" instead of delete and
it ran roughly 100 times a second but was leaking memory (IIRC about
400k a second)
Of course this is with objects not arrays, but I would be suprised if
the results differed.
>
> Regards,
>
> Andreas
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel