Don't ask to ask, just ask | |
PerlMonks |
Re^5: array pre-allocation trickby Aristotle (Chancellor) |
on Nov 02, 2002 at 06:52 UTC ( [id://209914]=note: print w/replies, xml ) | Need Help?? |
That very much depends on your setup. map can be the faster, slower or equal variant. There's too many constraints that play a role - you can't just say "this is faster" based on a minimal benchmark because the characteristics of each looping approach lend themselves to different data structure and control flow designs. If you take a forish approach, using map instead will be awkard - but the same is true in the reverse case.
Makeshifts last the longest.
In Section
Seekers of Perl Wisdom
|
|