for-in evaluation order
andreas.gal at gmail.com
Mon Dec 27 04:40:08 PST 2010
I can't speak for other VM implementors, but I think most implementors will not want to guarantee either enumeration method (property addition order vs numeric order). In some cases we store array data "dense", in others we punt and use a natural object representation. The decision when we switch between representations is a brittle heuristics. Allowing the underlying representation and along with it the enumeration order to bleed through is faster than normalizing (which in some cases would mean sorting property indexed names).
That having said, if TC39 decides to standardize enumeration order, I am pretty sure we can make pretty much any standard enumeration order reasonably fast (maybe a little less fast than before though). Mark suggested at some point enumerating indexed properties first in numeric order, and then all remaining properties. Its the most sensible approach I have heard so far. If someone drafts a proposal to standardize enumeration order, I volunteer to implement it in Firefox and get some performance data. That would help calming implementor's nerves.
> It's interesting. Could you summarize these objections?
>> On Dec 27, 2010, at 12:52 PM, Michael Day wrote:
>>> Thanks Boris, Dmitry,
>>>>> Are objects implicitly ordered, by implementation convention?
>>>> For implementations that have to deal with the web, yes.
>>> Okay, now I know what we have to do then :)
>>> Might I suggest that this be added to the spec, if only in an informative note, to save future implementers the trouble?
>>> Best regards,
>>> Print XML with Prince!
>>> es-discuss mailing list
>>> es-discuss at mozilla.org
>> es-discuss mailing list
>> es-discuss at mozilla.org
> es-discuss mailing list
> es-discuss at mozilla.org
More information about the es-discuss