Hi, Vish!
There are several inter-related to answers to your question.
- Browsers will usually compress the JavaScript files over the wire, so a 300KB JavaScript file should be around 60 - 70KB on the wire. Also, the primary reason why GWT uses HTML files instead of pure JavaScript files is to avoid a corner case where browsers will skip the compression.
i.e. JavaScript code compresses very well, and GWT tries very hard to make sure it truly gets compressed.
- GWT splits up the generated JavaScript so that a given browser doesn't waste time downloading and parsing JavaScript code it doesn't need. For example, Opera doesn't even download the Firefox-specific code in your application.
- The vast majority of your application's code is cacheable by the browser, meaning that it will take some time to download the first time, but browsers should be able to cache it thereafter.
What these points come down to is that while GWT apps can easily get into the 300KB+ range, GWT tries very hard indeed to keep file sizes small. We frequently compare the output of GWT to the output of hand-written equivalents, and GWT almost always wins. In cases where it doesn't win, we examine why and try to improve the compiler.
Additionally, in the upcoming 1.4 version, we have several compiler enhancements that will do some incremental improvements to reduce output file size even more.
Essentially: JavaScript as an application platform tends to have large-ish file sizes, and GWT is no exception. However, GWT is at least as good as any other framework you'll find.
As for tips to minimize your application size, the key thing is just not to turn off JavaScript obfuscation for deployment, and be sure you're judging your download size correctly. (The total download for a single browser is
gwt.js + nocache.html file + a single .cache.html file. Add up those file sizes to see how much a single browser will download.) If you truly want to benchmark this, consider installing Firebug which gives you great insight into what your JavaScript code is doing.
I realize this is not a simple topic to get your head around, but I hope that helps!
- Dan Morrill