One of the foundational principles in GWT is its "pay as you go" design approach. By restricting the use of reflection, the compiler can determine if a certain section of code is actually reachable on a method-by-method basis and subsequently eliminate any unnecessary code. For example, if you never utilize the remove() method on an ArrayList, that specific code will not be included in the resulting JavaScript file.
If you notice a significant increase in file size with just a small addition of code, it could indicate the introduction of a new type or dependencies on other new types that were previously not used. This increase may also occur when sending a new type back to the server for processing, causing the GWT generator to include additional JavaScript code for marshaling that type along with any related types.
In situations where a minor change results in a substantial increase in file size, it's advisable to examine the types being used and consider whether they are new additions, or if they have interdependencies with other types within the system.
A superstition mentioned by Ray Ryan during his 2009 presentation at Google I/O highlights the avoidance of generic types as RPC arguments and return values. Instead of using general types like Map, it's recommended to specify more specific types such as HashMap. The rationale behind this recommendation is that using more specific types allows the GWT generator to optimize the serialization process during compilation, potentially reducing the amount of unnecessary serialization code generated.
These insights might provide some clarity on optimizing your GWT application development process.