[stringtemplate-interest] it's 60% of time in ObjectModelAdaptor.getProperty()
Terence Parr
parrt at cs.usfca.edu
Fri Feb 4 12:44:10 PST 2011
and NOT the part that does reflection lookup.
public Object getProperty(ST self, Object o, Object property, String propertyName)
throws STNoSuchPropertyException
{
Object value = null;
Class c = o.getClass();
if ( property==null ) {
return throwNoSuchProperty(c.getName() + "." + propertyName);
}
// Look in cache for Member first
Member member = classAndPropertyToMemberCache.get(c, propertyName);
if ( member!=null ) {
try {
if ( member.getClass() == Method.class ) return ((Method)member).invoke(o);
if ( member.getClass() == Field.class ) return ((Field)member).get(o);
}
catch (Exception e) {
throwNoSuchProperty(c.getName() + "." + propertyName);
}
}
return lookupMethod(o, propertyName, value, c);
}
lookupMethod doesn't even show up of course. The double hashmap classAndPropertyToMemberCache could be an issue but it calls this method A LOT. can't see how to remove w/o static types. any ideas?
Ter
More information about the stringtemplate-interest
mailing list