QM wrote:

On Sun, Apr 17, 2005 at 03:44:59PM -0700, Kevin Burton wrote:
: We've had a few bottlenecks in our code that have since been removed but : the remaining big bottleneck is Tomcat. The JSP engine is creating : compiled code that is heavily relying on reflection.
: [snip]
: : Is there ANY way to get Tomcat to not use reflection in this situation.


How could a tag work without reflection?
For example, if you use any of the expression-language features, how is
Tomcat supposed to react to, say,

        ${request.somvar.something}

without dynamic invocation?



I'm not sure about this mechanism but if you take a function like:

<c:set var="test" value="${foo:bar()}" />

and rewrite it to use

<c:set var="test">
   <foo:bar/>
</c:set>

Then it won't use reflection.

This is why c:set and c:choose and so forth work so well.

There isn't a perf penalty here.

So this means I'll have to rewrite all my function calls to elements that are in tight loops.

There's also no reason that it MUST use reflection. I mean its a CODE generator so all you have to do is generate code that doesn't use reflection and calls the methods directly.

There.s about a .5ms overhead for reflected functions and if you have 1000 on a page (EASY!) then it will be DOG slow.

While I doubt you could make Tomcat not use reflection (without
completely hacking the source) perhaps you could share more details of
what you're doing... that may give the rest of us insight to help you
trim the bottlenecks more.  i.e. you mention lots of looping and
tag nesting; is there any way to change how that's done?



Well I think I'm going to have to review all forms of code that cause this and rewrite them.

The BIGGEST problem as I currently see it is with .tag files. These use reflection but I can't figure out a way to rewrite them.

I think if i were to do this it would yield DRAMATIC performance improvements.

The REAL issue is that enabling developers to shoot themselves in the foot like this is really irresponsible and probably needs to be removed or a HUGE warning be placed before examples.

Kevin

--


Use Rojo (RSS/Atom aggregator)! - visit http://rojo.com. See irc.freenode.net #rojo if you want to chat.


Rojo is Hiring! - http://www.rojonetworks.com/JobsAtRojo.html

Kevin A. Burton, Location - San Francisco, CA
AIM/YIM - sfburtonator, Web - http://peerfear.org/
GPG fingerprint: 5FB2 F3E2 760E 70A8 6174 D393 E84D 8D04 99F1 4412



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to