tugwilson schrieb:
[...]
The main execution cost is fetching the MetaClass for b (Ng wraps ints in
NgInt which has a getMetaClass method rather than Integer which requires a
registry lookup), a check to see if a Category has changed the plus
operation on int and a check that the plus operation on int has not been
monkey patched. These costs are exactly equivalent to your
"Integer#plus(Integer) is default" check, except the cost of getting the
MetaClass for Integer is higher in Groovy.
well... theoretically it is enough to reuse that check for a certain
amount of actions... for example:
int j=0;
for (int i=0; i<n i++) {
j+=i
}
In this case we could check the MetaClass for Integer and if it is not
modified, we could execute the code in its static form. This means for
all n nest() calls and all n plus class we have only a single MetaClass
check.
bye blackdrag
--
Jochen "blackdrag" Theodorou
The Groovy Project Tech Lead (http://groovy.codehaus.org)
http://blackdragsview.blogspot.com/
http://www.g2one.com/
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email