In theory, pop()ing would be more efficient than shift()ing since every so often the array will be moved down so that the gap in front of its memory space is not huge.Since Perl never does move the array down when you do shift, I don't see the purpose of this theory. You could exchange pop and shift in your theory and it would make as much sense and be as true.
In reply to Re: Memory efficiency with arrays
by Dominus
in thread Memory efficiency with arrays
by Hot Pastrami
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |