Help for this page

Select Code to Download


  1. or download this
               Rate splicing  radiant
    splicing 2371/s       --     -19%
    radiant  2936/s      24%       --
    
  2. or download this
    C:\Perl\progs>perl -v
    This is perl, v5.8.8 built for MSWin32-x86-multi-thread
    <snip>
    Binary build 817 provided by ActiveState
    
  3. or download this
    C:\Perl\progs>scratchpad.pl 6000 7000 10000
    Array size: 10000
    Inserting: 6000 .. 7000
               Rate splicing  radiant
    splicing 28.1/s       --     -86%
    radiant   198/s     603%       --
    
  4. or download this
    C:\Perl\progs>scratchpad.pl 60000 61000 100000
    Array size: 100000
    Inserting: 60000 .. 61000
               Rate splicing  radiant
    splicing 2.87/s       --     -93%
    radiant  42.7/s    1388%       --
    
  5. or download this
    use strict;
    use warnings;
    use Benchmark 'cmpthese';  
    ...
      splicing => sub { my @ary = 1 .. $SIZE;
        insert2( \@ary, 1 ,$_ ) for $START .. $END },
    } );