Am 01.08.2006 um 21:23 schrieb Sebastian Werner: > Andreas Junghans schrieb: >> Oh, and I think I missed a crucial point why your IE delete time is >> so high. It's probably not because of the garbage collector, but >> because the array gets reorganized on every delete (since an index is >> actually removed from it as opposed to simply assigning a new value). >> Looks like Firefox is way more efficient here ... > > the delete doesn't shorten the array in my opinion.
It doesn't change the "length" property of the array, but it does remove the index from the key collection (see "http:// developer.mozilla.org/en/docs/ Core_JavaScript_1.5_Reference:Operators:Special_Operators:delete_Operato r", last paragraph). After all, a JavaScript array is nothing more than a hash map with an additional "length" property. If you use "delete" on an index, the spec says that "index in myArray" should return false. To be able to do so, there has to be a collection of all the indices somewhere, and this collection is affected by the "delete" operator. Regards, Andreas ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
