in reply to Re: The Virtue of Laziness
in thread The Virtue of Laziness
I doubt that a for ("a",@ar,"z") {} is still that performant, because the heuristics might not detect anymore the array in between
LanX, you are right:
cmpthese(0, { map => sub {map_die(\@arr)}, for => sub {for_die(\@arr)}, }); sub map_die ($ar) { eval {map {die} 0, @$ar}; } sub for_die ($ar) { eval { for (0, @$ar) { die; } } } __DATA__ Rate for map for 1390/s -- -1% map 1404/s 1% --
Greetings,
🐻
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: The Virtue of Laziness
by LanX (Saint) on May 05, 2024 at 10:14 UTC |