Sometimes it makes sense to compare the total effect of one approach to
another... like comparing your favorite cereal to a competing product.
Nothing speaks better than hard and fast facts like... It would take over
two and a half million bowls of your oat bran cereal to equal the fiber
content of one bowl of Super Colon Blow.

Yes... Arrays/Collections are like Frosty Coated Sugar Lumps and
Dictionaries and Associative Arrays may rock your insides so hard that
you¹ll have to take stock in depends. When all else fails ­ cereal metaphors
provide crystal clarity.

http://www.nbc.com/Saturday_Night_Live/video/clips/colon-blow/229046/
http://www.insideria.com/2008/04/dictionaries-and-associative-a.html

Rick Winscot


On 12/11/08 6:19 PM, "Alex Harui" <aha...@adobe.com> wrote:

>  
>  
> 
> You have too much time on your handsŠ
>  
> I would expect collections to iterate much faster by using getItemAt or
> cursors instead of array indexers or for..in.  I swear someone published a
> comparison once.
>  
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf
> Of Josh McDonald
> Sent: Thursday, December 11, 2008 2:57 PM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Re: speed of the "for each" looping
>  
> 
> I've spent a lot of time poking around inside the collections stack (it's just
> interesting), and I can't find a situation where you'll get a different order
> for for each..in over indexed looping at the moment (Fx 3). That could of
> course change without notice, but for now I think that where speed isn't
> important, you can safely pick the one that produces the prettier or more
> comprehensible code :)
> 
> -Josh
> 
> On Fri, Dec 12, 2008 at 5:32 AM, Alex Harui <aha...@adobe.com> wrote:
> 
> Funny.   I didn't realize we were talking about iterating arrays with for..in
> until just now.  I don't think we do that in Flex code.  If the docs say
> arrays will iterate via for..in in index order then I'd probably trust that,
> especially if you stuff your arrays in index order
> 
>  
> 
> From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf
> Of Dave Cragg
> Sent: Thursday, December 11, 2008 3:08 AM
> To: flexcoders@yahoogroups.com
> Subject: Re: [flexcoders] Re: speed of the "for each" looping
> 
>  
> 
> Could you clarify this? Does this non-guarantee apply to numerically indexed
> arrays and ArrayCollections too? Or just to associative arrays and object
> properties?
> 
>  
> 
> The docs imply that the order is maintained by for...in with numerically
> indexed arrays. It would be a big change if that were not the case.
> 
>  
> 
> Cheers
> 
> Dave
> 
>  
> 
> On 10 Dec 2008, at 23:00, Gordon Smith wrote:
> 
>  
> 
>  
> 
> So don't use for..in or for eachŠ in if you care about the enumeration order.
> It could very possibly change in future versions of the Flash Player.
> 
>                  
> &nbs! p;         
> 
> Gordon Smith
> 
> Adobe Flex SDK
> 
> 
> 

Reply via email to