[stringtemplate-interest] it's 60% of time in ObjectModelAdaptor.getProperty()

Johan Stuyts j.stuyts at javathinker.com
Sun Feb 6 21:47:32 PST 2011


> Oh, I thought you were talking about on the fly compilation. I highly
> doubt (though I have zero numbers to prove) that there are many
> scenarios where on the fly compilation is actually faster than dynamic
> invocation.

Indeed. You would have to benchmark it to see if the additional complexity  
and effort is worth it.

I once ran a simple test where I replaced an Interpreter pattern with code  
compiled with Janino[1]. The code got called very often, so I figured  
HotSpot would kick in and convert it to very efficient native code.  
Unfortunately the results were disappointing. The Interpreter-style code  
was faster than the generated classes. But this was quite a number of  
years ago, so things might have changed.

Johan

1. http://docs.codehaus.org/display/JANINO/Home


More information about the stringtemplate-interest mailing list