Just another Perl shrine | |
PerlMonks |
Re^2: perl 5.36 and the for_list feature - a simple speed comparisonby kcott (Archbishop) |
on Jun 21, 2022 at 21:30 UTC ( [id://11144922]=note: print w/replies, xml ) | Need Help?? |
G'day Dean, "List::Util::pairmap would be an existing solution very similar to the new feature. It also seems to run quite quickly (but I can't compare it to for_list since I don't have a new-enough perl)." No problem. I have v5.36.0 installed. I added your code to the OP benchmark code. Mine starts as follows. Refer to "perl5360delta: use v5.36" for why I removed the strict and warnings pragmata.
I then added:
I ran the benchmark five times. All results were pretty much the same; here's a median set:
In all runs, a_pairmap was second fastest; and, h_by_key was faster than h_each (which differs from the OP results). My environment:
— Ken
In Section
Meditations
|
|