Because all of the map-based methods construct, copy and later discard, multiple, intermediary lists on their way to constructing the hash.
And the costs of doing large numbers of small memory allocations and deallocations add up; especially if they memory manager has to go to the OS a couple of times to expand the process memory pool.
Using for avoids constructing many of the intermediary lists.
In reply to Re^4: better array to hash conversion
by BrowserUk
in thread better array to hash conversion
by perltux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |