[stringtemplate-interest] Raw speed!
VAUCHER at fermat.fr
Thu Oct 13 08:48:14 PDT 2005
I've tried StringTemplate yesterday and am already falling in love
with it. I won't enumerate all its advantages, but will instead raise a
point about performance. The bare fact is that the library "as is" is a
bit slow for my current needs. I think there are several causes :
1 ) the way properties are retrieved, for standard classes (isXXX,
getXXX or field access) is not recorded and has to be recomputed on each
2 ) property access must use reflection ;
3 ) compared to JSP, StringTemplate's are evaluated, not compiled.
Please, let me know if you think there are other crucial things.
I made a quick hack to fix the first point (thanks to/for the
open-sourceness of the lib) and observed a direct 25% decrease in
elasped time. Nice!
But I'm still not satisfied and, alas, points 2 and 3, which are
linked, cannot be fixed so easily.
The next step in optimization would be a kind of
JIT-template-compiler. If I follow that road, I think the ASM library
could be a useful help (http://asm.objectweb.org).
What do you think?
More information about the stringtemplate-interest