Dan Sugalski writes:
: At 09:32 AM 5/8/2001 -0700, Larry Wall wrote:
: >Perl 6 might not put all the elements of @b on the stack as a temporary
: >list.  Rather, it might just put \@b marked as expandable.  (It might
: >also have to put some kind of copy-on-write lock on @b to keep it from
: >changing out from under, depending on how lazy the assignment (or
: >subroutine) actually gets about reading out the array.)
: 
: s/might not/won't/;
: 
: One of the places I hope to gain some speed is in eliminating flattening 
: and reconstitution of aggregate variables as much as possible. I'm hoping 
: to exploit this really heavily to save both the memory for the flattened 
: lists and the time it takes to flatten and reconstitute. (If we're really 
: lucky we might even be able to rehome some of the underlying data 
: structures, making returning a 10M entry hash cost about one pointer 
: assignment)

I suspect one way this saves us a lot of overhead is in knowing how
much memory to allocate for a given subroutine's stack frame.  The way
it is done in Perl 5, we pay the variadic stack overhead even on
subroutines that are known not to be variadic.  This is suboptimal,
since you have to be ready to extend the stack at any moment.  (It also
tends to pessimize linkage into pseudo-variadic languages like C.)

Larry

Reply via email to