[stringtemplate-interest] caching getter lookup speedup
Terence Parr
parrt at cs.usfca.edu
Mon Dec 27 12:09:57 PST 2010
howdy. I'm nervous about allowing random method names even w/o args. I've resisted for 10 years; i should probably stick with it. useful but too easily abused.
Ter
On Dec 27, 2010, at 11:35 AM, Udo Borkowski wrote:
> Good work!
>
> I guess I can now drop my PropertyAdapter stuff and switch to the new ModelAdaptor feature.
>
>
> Just a minor thing: when looking for a "by method" implementation of a property you check for the methods "getXXX" and "isXXX". While this is exactly as defined for JavaBeans I found it useful also to check for a method named "XXX". This will also cover properties like "hasFocus", "hasParameters", or even "initialValue" implemented by methods "hasFocus()", "hasParameters()" or "initialValue()".
>
> With this extension to the semantic of the ObjectModelAdapter guys like Rafael would not need to write their own Adapter but could just refer to every parameterless method of the "bean" as a "property" in their template.
>
> Apropos "parameterless": After finding a method (in getProperty()) only parameterless object methods should be accepted.
>
> Udo
>
>
>
> On 26.12.2010, at 20:59, Terence Parr wrote:
>
>> ok, added benchmarking code to v4. Tested speed with and w/o Method/Field caching. about 10x improvement. Average units of work went from 32.77 to 395.22. This is a micro benchmark for property lookup.
>>
>> timeSimplePropsOfArgs : 395.24 402.13 399.98 369.82 408.94 = 395.22 units of work / ms
>>
>> timeSimplePropsOfArgs : 32.63 32.74 32.68 32.95 32.83 = 32.77 units of work / ms
>>
>> Now I'm optimizing local attribute (arg) access. Sam Harwell will be happy :) I'll check those numbers after impl.
>>
>> Ter
>> _______________________________________________
>> stringtemplate-interest mailing list
>> stringtemplate-interest at antlr.org
>> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
More information about the stringtemplate-interest
mailing list