Reviewers: bobv,

Description:
Currently JsInliner.InliningVisitor.endVisit() tries a sequence of
identifiers of the form A_B_<number> until it finds one that has not
been used in the given scope.  Profiling indicates that this loop may
execute hundreds of times for a given name, accounting for a significant
amount of total run time.  This patch maintains a starting point for
each identifier in a HashMap and only searches the namespace from that
starting point.  Empirically we see the loop executing only one time
with this strategy.

It's possible we could do better by:

1) avoiding the loop altogether if we know that there cannot be any
collisions using this strategy
2) maintaining the starting points on a per-scope basis -- the current
approach might start at a higher number than necessary


Please review this at http://gwt-code-reviews.appspot.com/34820

Affected files:
   dev/core/src/com/google/gwt/dev/js/JsInliner.java



--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to