commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Curdt <tcu...@apache.org>
Subject Re: [jxpath] Java code from JXpath expression
Date Tue, 07 Mar 2006 21:16:31 GMT
>> Well, I am no expert but I think this cannot be done without huge  
>> hacks. Why
>> you want to do this? Do you want to use it as a code generation tool?
>
> Yes... sort of.
> I'm having some performance issues related to the use of  
> reflection, I was thinking to "extract" the Java code from the  
> JXPath expression and then use Janino to compile it, this way I  
> would use reflection only once (to generate the code).

IMHO that's an ugly approach ...rather I would try to improve jxpath.

When caching reflection you can get the same speed as native (at least
in some areas). Another option would be to generate byte code internally
(like XSLTC does) Going through the source code stage just to avoid
reflection speed sounds like the wrong approach to me.

...but even more important - if you want to optimize try to optimize
the larger picture first. Usually you earn much more when improving
the algorithm instead of the plain code.

My 2 cents
--
Torsten


Mime
View raw message