Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    
    cmpthese(-1, { algorithm => sub { my @r = algorithm(\@nums) },
               simple => sub { my @r = simple(\@nums) } })
    
  2. or download this
                Rate algorithm    simple
    algorithm 1517/s        --      -30%
    simple    2177/s       44%        --