http://gwt-code-reviews.appspot.com/1441803/diff/4001/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java File dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java (right):
http://gwt-code-reviews.appspot.com/1441803/diff/4001/dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java#newcode407 dev/core/src/com/google/gwt/dev/javac/CompilationStateBuilder.java:407: } On 2011/05/11 22:28:44, scottb wrote:
How important is this part, performance wise? Seems like it would
simplify
things a bit to leave CCU immutable and not update the
location/modified.
If it is important, instead of two different setters, a single
update(location,
lastModified) would be nicer semantically.
Calculating the contentId for the builder requires reading the source and performing an MD5 on the contents. Let's say, that someone upgrades or re-compiles gwt-user.jar with a small patch. This means that each time the compilation builder starts, the timestamp will be from old jar, but the actual contents will be the same. This means we open the resource passed to 'builder' and scan through it to compute the content ID, then we throw away the builder and use the bytecode from the cached unit (which is actually a different set of bytes, although they should be identical). I didn't measure the exact impact, but my intuition is that an extra scan of all the source in gwt-user is more expensive than not scanning at all. http://gwt-code-reviews.appspot.com/1441803/diff/4001/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java File dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java (right): http://gwt-code-reviews.appspot.com/1441803/diff/4001/dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java#newcode215 dev/core/src/com/google/gwt/dev/javac/CompilationUnit.java:215: public abstract CachedCompilationUnit asCachedCompilationUnit(); On 2011/05/11 22:28:44, scottb wrote:
With this, should make writeReplace() final and concrete, methinks.
Done. http://gwt-code-reviews.appspot.com/1441803/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
