[stringtemplate-interest] caching property lookup (sync issue too)

Terence Parr parrt at cs.usfca.edu
Sat Jul 15 07:46:05 PDT 2006


On Jul 15, 2006, at 3:07 AM, Micheal J wrote:

>> On July 11 2006, Terence Parr wrote:
>>
>> Well, i just profiled ANTLR generating the thousands of lines
>> of Java
>> code for a C grammar.  The reflection part took 120microseconds so
>> about an 1/8 of 1ms.  This is w/o the property caching.  I have
>> commented out for simplicity in the source and avoided a synch.
>> problem at same time.
>
> It might just be that your particular test case(s) do a minimal  
> amount of
> reflection. I imagine that ST-based web page generation is likely a  
> heavier
> user of reflection - in general - than source code generation. If only
> because of the much-longer lifetime of ST group instances...
>
> Just a thought.

Well, I suspect that ANTLR is a much heavier user since any x.y uses  
reflection unless it's a Map.  ANTLR's output templates are much  
bigger and more complicated than a web page so I'm hoping we're ok  
removing it. :)

Ter



More information about the stringtemplate-interest mailing list