Let's start with the less important, draft compilation. By default the GWT compiler generates highly optimized Javascript code. Unfortunatelly this may result in very slow compilation, many minutes for large projects. Draft compilation speeds up the compilation process dramatically by generating unoptimized Javascript code. The difference is remarkable, the following comparation shows the compilation times of a large project I'm working on:
GWT version | Compilation time | Javascript size (Firefox target) |
---|---|---|
1.7 | 72.234 s | 1 405 788 bytes |
2.0 | 103.966 s | 1 264 586 bytes |
2.0 draft compile | 48.937 s | 1 408 284 bytes |
By far the most important new feature is the new development mode which replaces the old hosted mode. Before 2.0, application development was sometimes very painful, because the hosted mode GWT shell has very serious problems and limitations. It is built on old and platform-dependent technology, for example in case of Windows it's using an embedded version of the IE6 control, which led to some of the following problems:
- IE6 is the slowest browser (which is still in use), its Javascript execution speed is with an order of magnitude slower than - for example - of Firefox.
- IE6 often fails when W3C standards compliance comes into question.
- The great development tools of Firefox (like FireBug) cannot be used.
- Last, but not least, the shell runs in a very constrained environment, which makes the usage of some more advanced functions impossible, for example see GWT 1.7 shell ActiveX/applet problem or Issue 1377: <applet> entries cause GWT to stop/crash Hosted Mode
There is another way to speed up the compiler, reduce the browser support for compilation (such as compile for firefox only) or compile only your locale
ReplyDeletethis link is interesting
http://blog.bazoud.com/post/2008/07/31/Can-I-speed-up-the-GWT-compiler-Part-II
Thanks for the tip.
ReplyDeleteWe already use it to speed-up the compilation during development, and we usually build only for FF target (again, because FF is faster and FireBug is great :).