http://gwt-code-reviews.appspot.com/1236801/diff/22001/6004
File
dev/core/src/com/google/gwt/dev/javac/rebind/CachedClientDataMap.java
(right):

http://gwt-code-reviews.appspot.com/1236801/diff/22001/6004#newcode30
dev/core/src/com/google/gwt/dev/javac/rebind/CachedClientDataMap.java:30:
public CachedClientDataMap() {
Yes, the idea is that we will implement persistent caching for generator
results (but that is not currently implemented here).  I made it
Serializable in anticipation of that.  Agreed, if the rebind cache entry
fails to deserialize, it should behave as if there was no available
cache entry (in which case the generator would know to run from
scratch).

On 2011/01/04 21:39:06, tobyr wrote:
Is this supposed to be for persistent caching across runs? Is there
code that
serializes/deserializes it somewhere? If it fails to deserialize, then
we
probably need to handle it by running the generator again.

http://gwt-code-reviews.appspot.com/1236801/diff/22001/6009
File dev/core/src/com/google/gwt/dev/javac/typemodel/JClassType.java
(right):

http://gwt-code-reviews.appspot.com/1236801/diff/22001/6009#newcode574
dev/core/src/com/google/gwt/dev/javac/typemodel/JClassType.java:574: *
structure of a type.  Use a type's publicly accessible api to build a
Hmmm....I guess I thought the 2 were interchangeable here, since from
the standpoint of a generator, what matters is what might have changed
based on what can be returned by a type's public api.....I think I'm
only using public api here to build the structure (except maybe some of
the annotation getters, which by rights should be public api)....

On 2011/01/04 21:39:06, tobyr wrote:
I think you need to reword this, since you're building the signature
based on
the type's structure, not the public API.

http://gwt-code-reviews.appspot.com/1236801/diff/22001/6009#newcode683
dev/core/src/com/google/gwt/dev/javac/typemodel/JClassType.java:683:
lazyTypeStructureSignature =
Util.computeStrongName(sb.toString().getBytes());
I thought about using references to each object (instead of Strings),
but I think that won't work in the case of persistent caching.   To
individually go through each structural component (with it's own
sub-structure implementation) felt problematic, since the
implementations can change for Methods, Fields, etc.....But yeah, I
think we can optimize it to generate a byte[] or byte[][] array, without
the intervening Strings....

I think the MD5 algorithm used by Util.computeStrongHash is pretty
efficient, but I'm sure there are simpler, faster things we can use (or
maybe don't hash it at all, just keep the full raw
signature....trade-off being more memory to store and slower comparison
times between signatures)...

The number of type signatures that get created will increase if this is
utilized also for RPC, of course, so agreed, need to characterize the
impact.

The alternative being what I had before, which was a simple last
modified date stamp on the source file (which is problematic for freshly
generated source files, or those living in jars, etc.).

Do you feel like the api here is perhaps good enough for now (we can
continue to optimize later with a subsequent patch)?

On 2011/01/04 21:39:06, tobyr wrote:
This function looks expensive:

1) We're iterating over a lot of stuff. Probably can't be helped.
2) We're using lots of functions that create lists of strings from
bits. Seems
like we could just use the bits directly.
3) The hash function seems potentially expensive.

Can we measure it? How many times will it be called? (For example,
100us * 1000
= 100ms, which is 2% of our total budget). We don't want to add new
work into
the cost of refreshes, so we need to have a plan for dealing with this
if it
turns out to be non-trivial.

http://gwt-code-reviews.appspot.com/1236801/diff/22001/6011
File user/src/com/google/gwt/resources/ext/ClientBundleRequirements.java
(right):

http://gwt-code-reviews.appspot.com/1236801/diff/22001/6011#newcode66
user/src/com/google/gwt/resources/ext/ClientBundleRequirements.java:66:
void addTypeAndSuperTypeHierarchy(JClassType type);
On 2011/01/04 21:39:06, tobyr wrote:
How about just addTypeHierarchy?

Done.

http://gwt-code-reviews.appspot.com/1236801/show

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

Reply via email to