2 ms·
No. map should be much slower than a for loop, because map has to cons the result list, while the for loop only does it for side effects, but ignores all the re
by rurban 8y ago
No. map should be much slower than a for loop, because map has to cons the result list, while the for loop only does it for side effects, but ignores all the return values. If map is faster, then there's some thing wrong with the loop optimizer or loop run-time overhead.
In cperl there are many loop optimizations which are not in perl5. I'm pretty sure "for" is faster than "map" there.