On Thu, 15 Aug 2002, Larry Wall wrote:

> On Thu, 15 Aug 2002, Deven T. Corzine wrote:
> : I've got another idea.  How about using a copy-restore technique?
> 
> I suspect that would make Perl 6's sub calls even slower than Perl 5's.

Yes and no.

For the normal case (pass-by-value semantics), it should be about the same 
speed as Perl 5, since it would be doing the same thing: making a copy of a 
value that was passed by reference.

For the "is ro" or "is ref" case, it should be FASTER, since it could avoid 
the copy by aliasing the reference.

Only the "is rw" case would be slower, since it would involve two copies 
rather than one.  However, it would offer a benefit of "rolling back" any 
changes to the parameters in case of an abnormal exit from the function.  
This seems like a valuable feature that could often be useful -- and anyone 
who wants to avoid the speed penalty could stick with "is ref", assuming 
that option is also allowed...

Deven


Reply via email to