RE: JavaMemoryModel: Mutually exclusive goals for Java memory model

From: Bill Pugh (pugh@cs.umd.edu)
Date: Fri Apr 19 2002 - 08:05:19 EDT


At 6:15 AM -0400 4/19/02, Doug Lea wrote:
>Do you (or anyone) have any performance data comparing concatenation
>followed by String construction in nio CharBuffers vs StringBuffers?
>If this were faster, given that it already exists, it is tempting to
>just redefine String "+" to use CharBuffers, to replace nearly all
>current uses of StringBuffer with CharBuffer inside JDK library
>classes, and to encourage programmers to do likewise.
>
>If it isn't faster, maybe something could be done (in next nio JSR)
>to make it faster.
>
>-Doug

I think the fundamental problem with this approach is that
CharBuffers have a fixed capacity, specified when they are
constructed. For a replacement for StringBuffers, you need something
that can autosize/expand.

        Bill
-------------------------------
JavaMemoryModel mailing list - http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:39 EDT