| 1 |
#!/usr/bin/env perl |
| 2 |
|
| 3 |
use warnings; |
| 4 |
use strict; |
| 5 |
|
| 6 |
my @TESTS = $#ARGV == -1 ? qw(1 2 3 4 5 8) : @ARGV; |
| 7 |
my $NTRIES = 5; |
| 8 |
|
| 9 |
!system("./crawl --builddb") or die "Rebuilding the db failed -- bailing.\n"; |
| 10 |
|
| 11 |
# Load the db into the page cache, make the disk idle. |
| 12 |
system("tar cf - saves/db saves/des >/dev/null 2>/dev/null"); |
| 13 |
system("sync"); |
| 14 |
|
| 15 |
my (%results, %times, $test); |
| 16 |
for $test (@TESTS) |
| 17 |
{ |
| 18 |
my @times; |
| 19 |
for (1..$NTRIES) |
| 20 |
{ |
| 21 |
my $u0 = (times)[2]; |
| 22 |
system("test/stress/run " . $test); |
| 23 |
my $u1 = (times)[2]; |
| 24 |
push @times, $u1 - $u0; |
| 25 |
} |
| 26 |
$results{$test} = $times[($NTRIES+1)/2]; |
| 27 |
} |
| 28 |
|
| 29 |
print STDERR "Version: "; system("(git describe 2>/dev/null || cat util/release_ver) >&2"); |
| 30 |
printf STDERR "%s %10.2f\n", $_, $results{$_} for sort keys %results; |