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

Re: Parrot Glossary - COW

Thread Previous | Thread Next
Larry Wall
July 5, 2002 10:12
Re: Parrot Glossary - COW
Message ID:
On Fri, 5 Jul 2002, Nicholas Clark wrote:
: On Fri, Jul 05, 2002 at 02:54:18PM +0200, Aldo Calpini wrote:
: > this approach saves memory, because you can create as many copies of a
: > string as you want, without allocating it many times. unless you modify
: > them, at least. it's also usually a great speed boost, because copying a
: > string is performed in O(1) time, instead of O(n) - where n is the size of
: > the string.
: I suspect that the speed boost is going to be more noticeable for most
: applications than the memory saving. It doesn't matter if I'm wrong on this :-)

It's a real win for regexes that want to map $1, $2, etc. onto an existing
string.  Not to mention $`, $& and $'.


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