For our rather large project (19MB), generated Errai code accounts for a considerable amount of it (42%). Looking through the generated code, it seems there is quite a bit of code that could be shared between code marked with @Bindable and @Portable.
Our biggest concern continues to be SDM performance. It seems that in general, the GWT compiler just isn't as efficient with the generated classes as it is caching 'regular' java code. As well, even if the compile sufficiently reduces the size of the code for production, the fact that all this code has to be managed in SDM ends up dragging down performance.
I have mocked up a proposal and put it on Github:
Would very much appreciate your feedback.
I propose the creation of a new 'ReflectionOf' interface, for which all @Bindable/@Portable classes would generate a class that would have getProperty/setProperty/getProperties/getClassForProperty/makeNew methods.
The marshaller/demarshaller would be able to leverage the information in the Reflection class in order to more generically loop through the properties for the class in question, greatly reducing the amount of code per marshaller.
The BindableProxyImpl would also leverage the reflection class to better handle unwrap/DeepUnwrap, thereby greatly reducing the generated code
The reflection class would be available with static public property names for other code to leverage.