There is an additional benefit to this optimization that goes beyond
speeding up the compiler.  It should produce faster Javascript as
well.  Unless I'm mistaken, using an iterator to iterate over a list
requires the creation of a Javascript object to represent the
iterator.  That object creation can be avoided by iterating over the
list by index instead.  On Blueprint, we have been avoiding using the
nice for...each construct for this very reason.  Unfortunately, I
don't have any data that suggests just how much of a difference the
index instead of iterator makes.
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to