$ perl -MBenchmark=cmpthese -e'cmpthese( 2e6, { ri=>sub{return int @_}, rs=>sub{return scalar @_}, rz=>sub{return 0+@_}, i=>sub{int@_}, s=>sub{scalar@_}, z=>sub{0+@_}})' (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) (warning: too few iterations for a reliable count) Rate rz ri z rs i s rz 14285714/s -- -21% -21% -43% -43% -57% ri 18181818/s 27% -- -0% -27% -27% -45% z 18181818/s 27% 0% -- -27% -27% -45% rs 25000000/s 75% 37% 37% -- 0% -25% i 25000000/s 75% 37% 37% 0% -- -25% s 33333333/s 133% 83% 83% 33% 33% -- #### Rate rz ri z rs i s rz 3076923/s -- -5% *-6%* -9% -11% -15% ri 3225806/s 5% -- -2% -5% *-6%*-11% z 3278689/s *7%* 2% -- -3% -5% -10% rs 3389831/s 10% 5% 3% -- -2% *-7%* i 3448276/s 12% *7%* 5% 2% -- -5% s 3636364/s 18% 13% 11% *7%* 5% --