iteration order for Object

Boris Zbarsky bzbarsky at MIT.EDU
Thu Mar 10 18:11:59 PST 2011


On 3/10/11 9:00 PM, Charles Kendrick wrote:

> People use Objects as classes, instances, "associative arrays" / Maps,
> etc. Numeric keys are a tiny minority and there would be no measurable
> performance gains for special treatment of such keys *on Object*.

You may want to read 
<https://bugzilla.mozilla.org/show_bug.cgi?id=594655> and 
<https://bugzilla.mozilla.org/show_bug.cgi?id=611423>.  People are 
running into performance issues due to lack of such special treatment today.

Now maybe these people are just doing dumb things they shouldn't be 
doing, but that doesn't make the performance differences observed on 
those tests "not measurable".

> However because frameworks have to deal with all possible keys, we end
> up with a much, much more expensive data structure that has to be used
> just because numeric keys are being treated specially.

I agree this is an issue.  I just think you're underestimating the 
performance drag of preserving numeric property order for vanilla Objects.

-Boris


More information about the es-discuss mailing list