Hi Henning, yes I did know about StringBuilder, which was the original inspiration. As Click targets Java 1.4 it wasn't really an option.
I didn't know about StrBuilder however, thanks. I will try and dig up some performance numbers. thanks Malcolm On 3/22/07, Henning P. Schmiedehausen <[EMAIL PROTECTED]> wrote:
"Malcolm Edgar" <[EMAIL PROTECTED]> writes: >Ahmed's comments the other day got me thinking about performance >issues. One change we made to the Click Framework was to introduce a >HtmlStringBuffer class, which is basically a traditional StringBuffer >class but without the synchronization. This removes the need for Congratulations, you have just re-invented StringBuilder... :-) http://java.sun.com/j2se/1.5.0/docs/api/java/lang/StringBuilder.html 1.5 only, though. >synchronization checks, this provided a measurable performance >improvement. >I did a quick search on Velocities code base and there are about 29 >classes which have references to the class, some of them many be >significant in terms of performance. Run the current codebase under 1.5. Replace StringBuffer with StringBuilder, rebuild, retry. I'd be very interested in numbers here. If 1.5 scares you, update commons-lang to 2.2 and use StrBuilder http://jakarta.apache.org/commons/lang/api-release/org/apache/commons/lang/text/StrBuilder.html The cool thing about Java is, that *everything* has already been invented. ;-) Best regards Henning -- Henning P. Schmiedehausen -- [EMAIL PROTECTED] | J2EE, Linux, |gls 91054 Buckenhof, Germany -- +49 9131 506540 | Apache person |eau Open Source Consulting, Development, Design | Velocity - Turbine guy |rwc |m k INTERMETA - Gesellschaft fuer Mehrwertdienste mbH - RG Fuerth, HRB 7350 |a s Sitz der Gesellschaft: Buckenhof. Geschaeftsfuehrer: Henning Schmiedehausen |n "Save the cheerleader. Save the world." --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
