After discussing further with Scott, there's probably a better way to
solve this one.  Closing this review and retooling.....

It turns out this does result in a significant savings in practice, for
projects with lots of ClientBundles with resources outside of the module
space.  So this approach will serve as an example solution for a
concrete problem.

But the solution should not alter the global ResourceOracle shared by
other unrelated generators.  However, question is whether keeping a
local resource oracle for use only by ClientBundles would not incur
significant overhead, since it would imply adding a mechanism for
maintaining extra framework for handling per-generator resource oracles,
and refreshing them, etc.

Toby's longer term proposal of adding a custom a indexing classloader
implementation is a more promising approach here, since circumventing a
slow class loader lookup would no longer be necessary, and things would
just work (assuming the classloader can be kept up to date
successfully).




http://gwt-code-reviews.appspot.com/1356801/diff/1/4
File
dev/core/src/com/google/gwt/dev/resource/impl/ExpandableResourceOracleImpl.java
(right):

http://gwt-code-reviews.appspot.com/1356801/diff/1/4#newcode28
dev/core/src/com/google/gwt/dev/resource/impl/ExpandableResourceOracleImpl.java:28:
public class ExpandableResourceOracleImpl extends ResourceOracleImpl
well, getPathPrefixes is public on ResourcesOracleImpl (but not
ResourcesOracle), so currently, generators don't have access to it.

http://gwt-code-reviews.appspot.com/1356801/diff/1/5
File user/src/com/google/gwt/resources/ext/ResourceGeneratorUtil.java
(right):

http://gwt-code-reviews.appspot.com/1356801/diff/1/5#newcode570
user/src/com/google/gwt/resources/ext/ResourceGeneratorUtil.java:570: if
(((GeneratorContextExt) genContext).isProdMode()) {
It's only dev mode, since the optimization depends on the initial
generator run discovering resource paths that caused a fallback to the
class loader, and then subsequent generator runs being able to take
advantage of the expanded resource oracle.  Generators don't run
multiple times for a given moduleSpace's ResourceOracle, in prodMode.

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

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

Reply via email to