|
Revision 21977, 503 bytes
(checked in by yappo, 5 years ago)
|
|
add benchmark scripts
|
| Line | |
|---|
| 1 | use strict; |
|---|
| 2 | use warnings; |
|---|
| 3 | use lib 'lib'; |
|---|
| 4 | use String::Diff qw(diff); |
|---|
| 5 | |
|---|
| 6 | my $old = join '', qw(ji ;hgiugsd ;hjlhseug gr;e:a guysag:f :ojigsy :dkaue:dii) x 16; |
|---|
| 7 | my $new = join '', qw(jifehiugg phrg:sgu :krhf:soi kfnjsyi :tjigsdhf gyrugs) x 16; |
|---|
| 8 | for (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 |
|---|