tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <bay...@essentially.net>
Subject Re: any plans to make taglibs EL nativly compile?
Date Thu, 01 Aug 2002 17:08:23 GMT
On Thu, 1 Aug 2002, Ian Tomey wrote:

> Just wondering if there were plans afoot to get the EL to compile to
> native code? bit quicker than intrepreting the expression every
> time...

We've considered this, and it is still part of the plan.  It's much more
feasible to attempt this with JSP 2.0 than with JSTL 1.0, for the
container already generates and compiles Java source (while JSTL 1.0
doesn't, and so would have to do so out-of-band).

Even then, however, it's not clear how beneficial the optimizations will
be.  Consider a sample expression like ${a.b}.  This expression means
vastly different things (at the Java-code level) if 'a' is a Map than if
'a' is a JavaBean.  But this information is only available at runtime.

It's possible to capture some of the structure of an EL expression in
compiled code, as with ${a + b = c}.  But even then, the type conversions
depend partly on information only available on runtime, meaning a fairly
thick runtime support library and, ultimately, diminishing returns with
respect to performance improvements.

Right now, the Jakarta implementation of JSTL caches all expressions,
meaning they don't need to be re-parsed when they're encountered.  My fear
is that this accommodates perhaps 90% of the performance improvement you'd
see with compiled expressions -- although this is just a guess.  More work
indeed needs to be done to determine how beneficial the optimizations will
be.  (If anyone's interested in contributing to this work, please let me
know, and I'll relay it to the JSR-152 spec leads.)

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message