RE: AS 2.0 optimising.. 2004-03-15 - By ryanm
Back > So -correct me if I'm wrong-, we have no strongly typed arrays, > yet. Array lookup should take 0(n) time, not a constant time. > I am guessing that they are using a dictionary internally, a > hashtable where values are indexed as strings [String name, > Object value]. > I believe you are correct, except that arrays should always be indexed by an integer, which should be *slightly* faster than using strings like the object collection does. Not because it is strongly typed (because it isn't), but simply because an integer index is just smaller and faster than a string index.
So, to state it another way, an array may compile to the same bytecode as an object collection, but since it uses an integer as an index it should be at least a tiny bit faster than a string indexed object collection.
ryanm
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Supported by Fig Leaf Software =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- Be sure to check the archives and the wiki: http://chattyfig.figleaf.com/ =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:107055 =-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe send a blank e-mail to: Normal Mode: flashcoders-unsubscribe@(protected) Digest Mode: flashcoders-digest-unsubscrive@(protected)
|
|