gwt /
gwt /
68cd70e35eb7987ebf091ede4193cc6417a9d775 Make compiler go faster. Particularly when you have:
a) Several permutations
b) More than one processor
It's also faster with several permutations and just one processor.
Here's the basic design:
1) Build a unified Java AST from Eclipse's JDT tree; represent unresolved deferred binding decisions as explicit nodes
2) Do optimizations on this tree.
3) Serialize into a byte buffer (thanks to Bruce for this tasty suggestion)
4) Crank up N worker threads
5) Each worker thread:
a) Grabs a particular permutation and deserializes its own copy of the unified Java AST
b) Resolves all deferred binding for that particular permutation
c) Optimizes the permutation with the new knowledge of deferred binding decisions
6) Profit!
Some notes:
- Doing step 2 up front on the unified tree actually realizes some performance gains by making step 5c take less time in each permutation, even when you have only one worker thread
- The number of worker threads created is Math.min(numberOfMachineProcessors, estimatedNumberOfASTsThatCanFitInMemoryConcurrently); in other words, there's no point creating extra threads if you don't have the memory for them, or you can't actually utilize the hardware. Permutation optimization barely touches the I/O, it's all CPU bound.
- Making the Java and JS ASTs serializable was surprisingly easy.
Review by: spoon
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@3303 8db76d5a-ed1c-0410-87a9-c151d255dfc7
26 files changed