[Mono-devel-list] StringBuilder patch

Paolo Molaro lupus at ximian.com
Tue Jan 13 11:47:30 EST 2004


On 01/12/04 Ben Maurer wrote:
> One other thing we should do is to preserve the old source. The old
> stringbuilder is actually VERY useful, and highly performant as a
> `string buffer'. For example, if you allocate one static stringbuilder,
> and use it multiple times, the cost of the extra slack on the end of
> strings is more than what is lost by having the extra char [] buffer.
[...]
> In this case, it is MUCH more efficient to do it the old way (assuming
> you have a pretty big number of strings.
> 
> So, it would be nice if we could publish the old source as a utility
> class. We should rename it something like Mono.StringBuffer.

The new code already creates a new string if the string buffer is unused
for the most part. Maybe the code can be changed in the future to use
some different criteria, like, don't waste more than x bytes etc.
I don't see any reason to keep the old code around: it's much more a
waste to keep it maintained and have two copies of mostly the same code
jitted in the same application.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list