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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to