Dan Sugalski writes:
: Yeah, a lot of that's definitely a problem, as is the manipulation of the 
: return stack and some assignment bits. (You can cut the time split takes in 
: half by having the destination array presized, for example)

That's why the current version Perl goes to a great deal of trouble to
hang onto its allocations from previous iterations/invocations, on the
theory that if you needed N elements last time, you'll probably need
about N elements again this time.  In changing how locals are generated
for Perl 6, it would be easy to lose such optimizations accidentally,
and that might be unfortunate.  It may be that there's a middle ground,
where by saving only the information and not the actual allocation, we
can estimate how much to reallocate the next time through without
actually hanging on to the memory in question.

Larry

Reply via email to