in reply to Re (tilly) 1: Memory efficiency with arrays
in thread Memory efficiency with arrays
With current versions of Perl it is slow to unshift.
It's probably also worth pointing out that unshift is fast if the array has previously been shifted. The shift leaves a gap at the beginning of the memory block, and when you unshift, Perl sticks the new data into the gap.
|
|---|