Help for this page

Select Code to Download


  1. or download this
    use strict;
    use Benchmark qw(timethese cmpthese);
    ...
    {
        my @sorted_array = sort {length $b <=> length $a} @array;
    }
    
  2. or download this
    Benchmark: timing 100000 iterations of Direct Sort, Orcish, Schwartzia
    +n...
    Direct Sort:  4 wallclock secs ( 4.00 usr +  0.02 sys =  4.02 CPU) @ 2
    +4900.40/s
    ...
    Schwartzian  7272/s          --        -31%        -71%
    Orcish      10561/s         45%          --        -58%
    Direct Sort 24907/s        242%        136%          --