Skip to content

Instantly share code, notes, and snippets.

@typester
Created October 23, 2008 02:30
Show Gist options
  • Save typester/18900 to your computer and use it in GitHub Desktop.
Save typester/18900 to your computer and use it in GitHub Desktop.
use FindBin::libs;
use Benchmark qw/cmpthese/;
use Array::Diff 0.05;
use Algorithm::Diff;
use Algorithm::Diff::XS;
my $d = Array::Diff->new({ diff_class => 'Algorithm::Diff' });
my $xs = Array::Diff->new({ diff_class => 'Algorithm::Diff::XS' });
cmpthese(
100000,
{
'Algorithm::Diff' => sub { $d->diff( [qw/a b d/], [qw/b a d c/] ) },
'Algorithm::Diff::XS' => sub { $xs->diff( [qw/a b d/], [qw/b a d c/] ) },
},
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment