On Mon, 12 Feb 2001 15:18:47 -0300, "Branden" <[EMAIL PROTECTED]>
wrote:

>Alan Burlison wrote:
>> Branden wrote:
>> > Any suggestions?
>> Yes, but none of them polite.

I do think this rudeness is uncalled for.

>> You might do well to study the way perl5 handles these issues.
>
>Perl 5 basically clones on every assignment. As it uses refcounting, it
>knows it doesn't need to clone a string if its refcount=1 and it's marked as
>temporary, i.e., only a temporary that will go away anyway knows about this
>string, so it's guaranteed no other reference to it will exist.

I did experiment with this idea just for fun some time ago:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-07/msg00550.html

If you follow the follow-up links, you will also find some benchmarks,
e.g. here:

http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/1999-07/msg00773.html

This approach could be valuable for *large* or [inout] style foreign
buffers (shared memory, mmaped files etc).  But it is questionable if the
overall gain in a few special cases is worth the added complexity in the
internals.

-Jan

Reply via email to