Roy Patrick Tan
-
2003-08-11
- summary: Remove reflection from generated interface surrogates --> Remove reflection from accessing interface surrogates
Even with the --noreflection option, generated code for
checking interfaces still use reflection to lookup model
fields. (For example, if a local model field is represented by
a model field of an interface).
A possible solution for removing these reflection calls is to
instantiate a surrograte object whenever a checked object is
instantiated (ie create them in the constructor). Thus, when
accessing model methods and fields, there is no need to call
getSurrogate().
Modifying the code generated by jmlc to use this strategy
reduced the running time by 42%