This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Non-synchronized StringBuffer
- From: Jeff Sturm <jsturm at one-point dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Java Discuss List <java at gcc dot gnu dot org>
- Date: Wed, 28 Nov 2001 00:02:59 -0500 (EST)
- Subject: Re: Non-synchronized StringBuffer
On 23 Nov 2001, Tom Tromey wrote:
> Tonight I hacked up something we've discussed here before: I changed
> gcj so that `+' of Strings uses a gcj-specific unsynchronized copy of
> StringBuffer.
Did you accomplish this without copying the char array? Perhaps by
constructing an empty String, then overwriting the data/boffset/count
fields?
> I was surprised to discover that in my simple test (several thousand
> String `+' operations), removing synchronization made the code slower.
> I have no explanation for this. In fact, if somebody else has an
> explanation I'd love to hear it.
If you can send me your patch and test I can run it through iprobe on
alpha/linux. That might reveal something.
Jeff