Tomcat optimization... saving internal strings with character encoding at compile time.

2005-05-29 Thread Kevin Burton
Another area that I'm noticing that Tomcat is spending a LOT of time in is with character encoding. Its not a ton of time but its really showing up as one of the top 20 areas of our webapp. Internally its either storing text as a java.lang.String or with genStrAsCharArray ... a char array

Re: looking for insight on invoking Thread.sleep() from a tomcat servlet

2005-05-29 Thread Kevin Burton
Clark O'Brien wrote: Can someone provide insight on the adverse affects of invoking sleep() from a servlet. I understand that the J2EE explicitly forbids invoking sleep from within a servlet and it is not hard to figure out this could cause problems given that a single tomcat thread may

Re: The amazingly slow performance of JSP (profiler results)

2005-05-28 Thread Kevin Burton
Dakota Jack wrote: You have to be and are comparing apples and oranges, Kevin, Perhaps... but my point was that JSP 2.0 doesn't HAVE to be this slow! :) because JSP *is* Java. DOH! It cannot run slower than what it is. No.. it could run slower... I'm sure the Tomcat developers will

Re: The amazingly slow performance of JSP (profiler results)

2005-05-28 Thread Kevin Burton
Peng Tuck Kwok wrote: Just to check are your precompiling the jsp page? Yes... we're precompiling them before we deploy. I'd recommend most people do that if they have the time. Kevin -- Use Rojo (RSS/Atom aggregator)! - visit http://rojo.com. See irc.freenode.net #rojo if you want

Re: The amazingly slow performance of JSP (profiler results)

2005-05-28 Thread Kevin Burton
Remy Maucherat wrote: For production configuration for Jasper, see: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jasper-howto.html#Production%20Configuration Cool... we have those set but I didn't see *genStrAsCharArray * **The interesting thing is that jprofiler clearly shows a big

Re: The amazingly slow performance of JSP (profiler results)

2005-05-28 Thread Kevin Burton
Peter Lin wrote: Back in 2002, I wrote several pages using JSP + java and JSP + JSTL to measure the actual cost of from a performance perspective. The performance difference isn't noticeable if a page has less than 50 tags. With 200+ tags, the performance difference does range from 2-5x slower

Re: The amazingly slow performance of JSP (profiler results)

2005-05-28 Thread Kevin Burton
Remy Maucherat wrote: It will obviously use more CPU and make more API calls. However, it does not allocate any objects, but instead will reuse per page objects (which is very fast). So overall, it sounds weird to me that the bottleneck would be on tag invocation. In the end, it's hard to beat

Re: The amazingly slow performance of JSP (profiler results)

2005-05-28 Thread Kevin Burton
Remy Maucherat wrote: For production configuration for Jasper, see: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jasper-howto.html#Production%20Configuration Do you know offhand if genStrAsCharArray has to be passed to jspc? I didn't notice this as one of the command line options in

genStrAsCharArray not available in JspC and performance increase?

2005-05-28 Thread Kevin Burton
So on: http://jakarta.apache.org/tomcat/tomcat-5.5-doc/jasper-howto.html#Production%20Configuration It recommends to use genStrAsCharArray when in production. This can be set in web.xml but not when using JspC from the command line. trimSpaces is there... but not genStrAsCharArray. Its in

Jasper generating garbage? new String() in generated code?

2005-05-28 Thread Kevin Burton
This is another smaller issue. c:set var=foo value=bar/ yields: _jspx_th_c_set_0.setValue(new String(bar)); If this is a constant string why does it need to continually call new String(bar) here? This is just going to waste CPU and cause more garbage to be generated which the GC

The amazingly slow performance of JSP (profiler results)

2005-05-27 Thread Kevin Burton
I've been tuning our application trying to get the maximum performance out if the system as possible. I've been throwing the system at jprofiler and allowing it to tell me where to optimized. In short Tomcat is slower than our DB, filesystem,. network and all other systems by about 4x.

Re: Reflection for custom taglibs killing performance...

2005-04-18 Thread Kevin Burton
Dakota Jack wrote: Why would you have to have an entirely new reflection for more than one database call? That sound like a design SNAFU to me. Looks to me like you should be having one use of reflection instead of 1000. I don't have to have it. Tomcat is *doing* it. Forget the DB. If I

Re: Reflection for custom taglibs killing performance...

2005-04-18 Thread Kevin Burton
Tim Funk wrote: Its not reflection killing you. For example, time this: %=System.currentTimeMillis()% c:forEach begin='0' end='${param.iterations}' ${more.cowbell} /c:forEach %=System.currentTimeMillis()% Where more is any java object and cowbell is a property (getCowbell()). In simple timing

Re: Reflection for custom taglibs killing performance...

2005-04-18 Thread Kevin Burton
QM wrote: On Mon, Apr 18, 2005 at 02:19:15PM -0700, Kevin Burton wrote: : So its clearly not JUST reflected methods its something else on top of : it What does your profiler report? -QM I can't for the life of me figure it out! It certainly reports that doTag is taking a LOT of time

Re: Reflection for custom taglibs killing performance...

2005-04-18 Thread Kevin Burton
Dakota Jack wrote: Why don't you break it down and find out where the time is going? So in summary.. now that I'm suspicious that its a tag instantiation issue I'm going to load up the webapp with FULL instrumentation... its about 8x slower but I think I'll need that level of granularity

Reflection for custom taglibs killing performance...

2005-04-17 Thread Kevin Burton
I've been spending this week running a profiler across our webapp and Tomcat. 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. Reflection shouldn't

Re: Reflection for custom taglibs killing performance...

2005-04-17 Thread Kevin Burton
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

Re: Reflection for custom taglibs killing performance...

2005-04-17 Thread Kevin Burton
Dakota Jack wrote: 1000 on a page? Really? That seems very odd to me given my experience. What would a page like that look like? Do you have examples? So psuedo code... - get a list of objects from your DB.. Say 500 - for each object tag A tag B tag C fn:length And so forth...