tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Fohrer <torsten.foh...@dcsi.de>
Subject AW: AW: [5.0] JSP performance ...
Date Tue, 09 Sep 2003 07:33:00 GMT

what's about char[] array/string reusing?
Create only a char array for each unique templatetext node. 

-> 
  10 x char[] jspx_text_1 = "something\n";
  1  x char[] jspx_text_1 = "something\n";


cu Torsten Fohrer

-----Urspr√ľngliche Nachricht-----
Von: Remy Maucherat [mailto:remm@apache.org]
Gesendet: Dienstag, 9. September 2003 09:00
An: Tomcat Developers List
Betreff: Re: AW: [5.0] JSP performance ...


Kin-Man Chung wrote:
> I have implemented generating text strings as char arrays, with a
> compiler option to turn it on and off, and did some timings on the
> benchmark.  Just as I suspected, the benchmark did not show much
> performance difference, when the option was turned on and then off.
> 
> Now I am wondering if there is any value in committing my change.  :(

Well, if it does improve results, it can't hurt, but the two should 
likely be similar. What did you get in your testing ?
I think what should be optimized is that there's twice the amount of writes.
Looking at the code generated, this situation seems rather common. So 
the idea would be to do a pass to merge all those TemplateText nodes :)

The profile showed about 75% of the CPU was spent in the JSP service (as 
usual with the VM profiles, it's probably misleading), and probably some 
of that time comes from the fact it has to invoke hundreds of methods.

Remy

>>I took a look at o.a.j.runtime.JspWriterImpl and the methods
>>
>>	write(String s, int off, int len)
>>and
>>	write(char cbuf[], int off, int len)
>>
>>in particualr, and failed to see any performance gain of the 2nd over the
>>first.  They are very similar, the only different is that the first uses
>>String.getChars while the second uses System.arraycopy, but those two
>>methods should be on par in terms of performance.  That is, I don't see
>>any extra unnecessary copies.
>>
>>Perhasp the culprit is those extra writes?
>>
>>-Kin-man


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message