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

Re: Mutable vs immutable strings

Thread Previous | Thread Next
From:
Joe Wilson
Date:
April 24, 2002 00:52
Subject:
Re: Mutable vs immutable strings
Message ID:
20020424050140.86270.qmail@web21109.mail.yahoo.com
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
http://games.yahoo.com/

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About