http://www.perlmonks.org?node_id=436698


in reply to Re: What is PERL_COPY_ON_WRITE Compile Option About
in thread What is PERL_COPY_ON_WRITE Compile Option About

To All:

Here is what I just found at
"Currently in perl when you write $a = $b, the contents of $b are immediately copied into $a. In theory perl could just pretend that it did the copy, and only actually do it if one of $a or $b is modified. If $b is a large string, and $a is never modified this could potentially be a big efficiency gain. This talk consists of simple pictures - how I didn't do it, and how I did."


DeadPoet
  • Comment on Re^2: What is PERL_COPY_ON_WRITE Compile Option About

Replies are listed 'Best First'.
Re^3: What is PERL_COPY_ON_WRITE Compile Option About
by BrowserUk (Patriarch) on Mar 04, 2005 at 18:41 UTC

    It appears that currently, COW is only used for certain copy operations--some of those in the regex engine, shared hash keys (or values?), and a few other places--but not currently simple scalars.

    It looks like the proposal is to extend it's reach.


    Examine what is said, not who speaks.
    Silence betokens consent.
    Love the truth but pardon error.
Re^3: What is PERL_COPY_ON_WRITE Compile Option About
by nobull (Friar) on Mar 05, 2005 at 18:56 UTC
    That was an excelent talk. Highly informative and imaginatively illustrated with several people holding up cards in a carefully choreographed sequence.