root/lang/perl/String-Diff/trunk/tools/benchmark-script.pl @ 21977

Revision 21977, 503 bytes (checked in by yappo, 5 years ago)

add benchmark scripts

Line 
1use strict;
2use warnings;
3use lib 'lib';
4use String::Diff qw(diff);
5
6my $old = join '', qw(ji ;hgiugsd ;hjlhseug gr;e:a guysag:f :ojigsy :dkaue:dii) x 16;
7my $new = join '', qw(jifehiugg phrg:sgu :krhf:soi kfnjsyi :tjigsdhf gyrugs) x 16;
8for (1..32) {
9    diff($old, $new)
10}
11
12__END__
13
14$ STRING_DIFF_PP=0 time perl tools/benchmark-script.pl
15        8.63 real         8.54 user         0.03 sys
16$ STRING_DIFF_PP=1 time perl tools/benchmark-script.pl
17        8.56 real         8.49 user         0.02 sys
Note: See TracBrowser for help on using the browser.