use 5.008;
use Benchmark;
use Arrays;
use PDL;
use strict;
use warnings;

# Benchmark different ways of passing arrays to XS
# Simply want to get the sum of all the elements

my @array = (0..1000);
my $pdl  = sequence(long,10001);

timethese(-3, {
	       'PDL' => sub { $pdl->sum; },
	       'List'=> sub { Arrays::sum_as_list(@array) },
	       'Ref' => sub { Arrays::sum_as_ref(\@array) },
	       'Pack'=> sub { Arrays::sum_as_packed( pack("i*", @array) ); },
	      });

