inlining and string concatenation
Jeff Sturm
jsturm@sigma6.com
Tue May 2 07:42:00 GMT 2000
"Boehm, Hans" wrote:
>> Has anyone thought about using a rope-like data structure (cf.
> http://reality.sgi.com/boehm/ropeimpl.html , or the cord implementation in
> the garbage collector distribution
> http://www.hpl.hp.com/personal/Hans_Boehm/gc/gc_source/cordh.txt ) for
> Strings?
I peeked at the cord implementation yesterday for that reason.
We would need a Unicode version of the cord library to start with. If
we only need temporary buffer allocation, Tom suggests we can allocate
on the stack, which defeats the purpose of using cords.
Changing the private array in java.lang.String to use cords would be an
interesting experiement, though not likely to be a win everywhere. In
particular it would complicate JNI and CNI methods that expose a
String's character array to native code.
It would be constructive anyway to benchmark the cord library against
StringBuffer and Bryce's experimental buffer implementation.
It'd be nice to have a Java version of the cord library too... I can
think of a few places I'd use it.
--
Jeff Sturm
jsturm@sigma6.com
More information about the Java
mailing list