in reply to map versus for
All the comments about better style still stand, but I would certainly have expected the map to be faster. This is odd. Anyone have a 5.10 to hand to see if anything has changed?
Sidenote:
is perhaps better written as: my @results = (0..1_000_000); (Of course, given your observation regarding map, whether it performs better is now a whole 'nother ball of wax.)# Populate list with 10 mio numbers for (my $i=0; $i<1000_000; $i++) { push @results, $i; }
|
|---|