develooper Front page | perl.perl6.internals | Postings from April 2002

Re: Mutable vs immutable strings

Thread Previous | Thread Next
Joe Wilson
April 24, 2002 00:52
Re: Mutable vs immutable strings
Message ID:
I vote for mutable strings.

Anything but immutable strings please!

Java sucks as a string manipulation engine because of their immutable
String class.  The best GC and JIT in the world can't save it.
High performance Java parsers generally write their own mutable
string class for this very reason.

Now the question is - do you want threadsafe strings or non-threadsafe strings?

If you want threadsafe mutable strings with a shared string buffer
you'll have to deal with mutex overhead even in the single threaded case
and performance suffers.
Either that or you must provide a sort of abstract string base
class and have both a threadsafe string implementation and non-threadsafe 
string implementation.  

Lots to think about.

Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About