Comment by cromwellian:

One of the nice things about immutability is if the compiler can prove it,  
you can avoid alias-analysis for those objects, which enables better  
copy-propagation/cse as well as equational-reasoning. Without it, any  
method call or store to a reference of the same type has to be treated as  
potentially mutating the value of a variable, which limits code motion.

Equational reasoning allows you to hoist out values of fields without  
worry, effectively allowing you to intercept constructor calls at compile  
time, and propagating constructing parameters around as constants. That is,  
code like `new Integer(10)` can simply replace any call to  
`Integer.intValue()` with `10`.






For more information:
http://code.google.com/p/google-web-toolkit/wiki/LightweightCollections

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

Reply via email to