commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [lang] FastStringBuffer?
Date Tue, 12 Aug 2003 23:24:12 GMT
AStringBuffer (A standing for Apache) has been on the list of TODO for ages.

The idea was to add extra methods to StringBuffer, including
- appendSilentNull() - ignore null
- other methods from StringUtils

This could be written as unsynchronized to get the combined effect.


Also, perhaps a bit of Security breaking reflection could access a private
constructor on String???

Stephen

----- Original Message -----
From: "Chris Feldhacker" <feldhacker.chris@mchsi.com>
> Thanks for the info -- I guess we can now say that it has been discussed!
>
> Incidentally, I did do some playing/rough testing with my own
> "FastStringBuffer" implementation.
> Notwithstanding the extra allocation needed when calling toString(),
making
> the methods unsynchronized resulted in a ~7% performance gain.  If I also
> removed the extra bounds-checking, the improvement was ~9%.  (Sun JRE
1.4.2)
>
> Glad to see Sun thought of making the same improvement -- better late than
> never!
>
> ----- Original Message -----
> From: "Gary Gregory" <ggregory@seagullsw.com>
> To: "'Jakarta Commons Developers List'" <commons-dev@jakarta.apache.org>
> Sent: Thursday, August 07, 2003 4:49 PM
> Subject: RE: [lang] FastStringBuffer?
>
>
> FYI, Java 1.5 will include a fast string buffer.
>
> From
>
http://developer.java.sun.com/developer/community/chat/JavaLive/2003/jl0729.
> html:
>
> "Laurence Vanhels: From profiling sessions, it's clear that any Java
program
> produces a huge number of String objects. Does the new release include any
> new clever optimizations to speed up the general use of Strings?
>
> Neal Gafter: Yes! String concatenation is fairly slow right now because
> StringBuffer is fully synchronized. We're adding an unsynchronized
version,
> java.lang.StringBuilder, with the same functionality but not synchronized.
> It will be used by the compiler to compile string concatenation
expressions,
> and this should significantly improve performance for some applications."
>
>
> Gary
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>


Mime
View raw message