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

Collin Fagan collin.fagan at gmail.com
Fri Feb 4 14:18:15 PST 2011


Ahh yes the compiler API, it's very cool. I remember experimenting with this
to do something similar to what you want, I was implementing a simple
interface that just returned a value and it was faster then reflection at
the time. I would warn though that using tools.jar in an application is not
a simple matter. tools.jar comes with a JDK because it is bound to *that *jdk.
As an example my current application uses JMX dynamic attach, also in
tools.jar. We have to compile against one tools.jar and then add the jdk's
tools.jar at run time to the classpath at *install *time. This is becouse
tools.jar has platform dependent code in it, or it refrences platform
dependand libraries. It's possible that the compiler API uses nothing of the
native libraries and that it might work to include tools.jar as a part of
ST, but I wouldn't count on it. ASM, cglib, and javasist all try to do the
same kinds of things... just in a more verbose way that I've never been able
to get my head around completely yet.

I really like the idea though.

Collin

On Fri, Feb 4, 2011 at 3:58 PM, Terence Parr <parrt at cs.usfca.edu> wrote:

>
> On Feb 4, 2011, at 1:55 PM, Terence Parr wrote:
>
> > great info. i remember you told me a while back.
> >
> > i wonder how easy this is in java using ASM or whatever.  i'd have to
> generate stubs and then figure out how to load. it's a solved problem but i
> wonder if there is a simple example.
>
> looks easy enough:
>
> http://www.javaworld.com/javaworld/jw-06-2006/jw-0612-dynamic.html?page=3
>
> Ter
>
> _______________________________________________
> stringtemplate-interest mailing list
> stringtemplate-interest at antlr.org
> http://www.antlr.org/mailman/listinfo/stringtemplate-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/stringtemplate-interest/attachments/20110204/b8802b30/attachment-0001.html 


More information about the stringtemplate-interest mailing list