On Wednesday 05 December 2001 10:36 am, Tom Klaasen (TeleRelay) wrote:
> Use StringBuffers. Check for log.isDebugEnabled(). Especially in loops.
> In May, this speeded up our application from 1s to 0.1s for certain
> pages (a speedup of euh... has anyone studied advanced math? ;) )
And be sure to set reloadable=false for the context in tomcat!
When you mention use StringBuffers, is it better to do
StringBuffer sb = new StringBuffer();
return sb.append("this").append("is").append("a string");
rather than
return "this" + "is" + "a string";
?
I was under the impression that the compiler would optimize the second case.
I do know to use a StringBuffer when in a loop that you're appending to a
string in tho :)
-pete
--
peter royal -> [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]