In all cases, you are building a global array, @ary, that gets up to eight million elements, each a reference to some perl type. That eats lots of memory, probably forcing you into swap and thrashing. The bigger the structure, the sooner. Swap is notorious for bad scaling.
To open and close IO::Handles inside the loop naturally takes more time than setting up an anonymous hash. In many cases you are contending against swap for the disk spindle.
After Compline,
Zaxo
In reply to Re: IO::Handle slowdowns?
by Zaxo
in thread IO::Handle slowdowns?
by mpaduano
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |