in reply to Re^7: Smartmatch alternatives
in thread Smartmatch alternatives
I'm starting to doubt if XS is really worth it.
Beside the hard to fix bugs, these modules are not that much faster.
In my benchmarks pure Perl5.10 approaches of any were in the range of 80%-50% of the speed of List::MoreUtils !
Interesting is
- map and grep were faster than for!
- directly hard coding the condition instead of calling a coderef wasn't faster!
- List::Util was slower than pure Perl
Rate PP_for LU_first PP_grep PP_map PP_mapdirec +t LMU_any PP_for 323355/s -- -4% -9% -16% -18 +% -47% LU_first 335913/s 4% -- -6% -13% -15 +% -45% PP_grep 356464/s 10% 6% -- -8% -10 +% -42% PP_map 387000/s 20% 15% 9% -- -2 +% -37% PP_mapdirect 395959/s 22% 18% 11% 2% - +- -35% LMU_any 612649/s 89% 82% 72% 58% 55 +% --
Have to repeat the benchmark with more test cases...
Cheers Rolf
( addicted to the Perl Programming Language)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^9: Smartmatch alternatives
by tobyink (Canon) on Dec 18, 2013 at 07:34 UTC | |
by LanX (Saint) on Dec 18, 2013 at 08:15 UTC |
In Section
Seekers of Perl Wisdom