$ 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% --