-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Xie,
On 3/2/2010 6:20 PM, Xie Xiaodong wrote: > Second, you are absolutely right about the log.info(....). I first > wrote like this for testing and forgot to get it back to debug > level. Don't forget that calling log.debug() with a bunch of string concatenations still performs those string concatenations. It's better to do something like this: if(log.isDebugEnabled()) log.debug(something + something else + a third thing); > In modern jvm, it does not matter much between StringBuffer and > StringBuilder, jvm will change StringBuffer used in single thread > scenario into StringBuilder automaticlly. No, it won't: if you ask for StringBuffer, you'll get a StringBuffer. If you just do "a" + "b", the /compiler/ will use StringBuilder if your target is 1.5+ but the JVM doesn't do anything like what you describe. > You could google this information. There are some benchmark test > about it. I'd love to see an example demonstrating your claim. - -chis -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEUEARECAAYFAkuOid0ACgkQ9CaO5/Lv0PD7FQCYjz53of2knok9gwKfyShrecka JACgjWY1WBpOYTSTJJ5dlDOO5BAnJJ4= =8yWQ -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org