http://gwt-code-reviews.appspot.com/1801804/diff/1/core/src/com/google/gwt/dev/shell/DispatchClassInfo.java
File core/src/com/google/gwt/dev/shell/DispatchClassInfo.java (right):

http://gwt-code-reviews.appspot.com/1801804/diff/1/core/src/com/google/gwt/dev/shell/DispatchClassInfo.java#newcode86
core/src/com/google/gwt/dev/shell/DispatchClassInfo.java:86: Integer id
= memberIdByMember.get(m);
On 2013/01/15 01:38:37, mdempsky wrote:
Is this a very heavily used function and/or does memberBy[Member]Id
get very
large normally?  If not, would it be simpler to just do:

   int id = memberById.indexOf(m);
   if (id == -1) {
     id = memberById.size();
     memberById.add(m);
   }
   memberIdByName.put(StringInterner.get().intern(name), id);

I believe that was essentially the implementation I originally wrote,
and was changed as part of a modification for performance and memory
usage (which is where the StringInterner calls came in).  At the time,
AdWords was having trouble running DevMode in a 32bit JVM.

I wasn't involved in that, but I presume there were lots of duplicate
strings which led to this being a win.

http://gwt-code-reviews.appspot.com/1801804/

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

Reply via email to