diff options
Diffstat (limited to 'src/test/performance/runtests.pl')
| -rwxr-xr-x | src/test/performance/runtests.pl | 117 |
1 files changed, 64 insertions, 53 deletions
diff --git a/src/test/performance/runtests.pl b/src/test/performance/runtests.pl index edf45ded2f..9c61b9a120 100755 --- a/src/test/performance/runtests.pl +++ b/src/test/performance/runtests.pl @@ -10,9 +10,9 @@ $DBNAME = 'perftest'; # This describtion for all DBMS supported by test # DBMS_name => [FrontEnd, DestroyDB command, CreateDB command] -%DBMS = ( -'pgsql' => ["psql -q -d $DBNAME", "destroydb $DBNAME", "createdb $DBNAME"] -); +%DBMS = + ('pgsql' => + [ "psql -q -d $DBNAME", "destroydb $DBNAME", "createdb $DBNAME" ]); # Tests to run: test' script, test' description, ... # Test' script is in form @@ -34,30 +34,37 @@ $DBNAME = 'perftest'; # an idea of what can be done for features unsupported by an DBMS.) # @perftests = ( -# It speed up things -'connection.ntm', 'DB connection startup (no timing)', -# Just connection startup time (echo "" | psql ... - for PgSQL) -'connection', 'DB connection startup', -'crtsimple.ntm', 'Create SIMPLE table (no timing)', -# 8192 inserts in single xaction -'inssimple T', '8192 INSERTs INTO SIMPLE (1 xact)', -'drpsimple.ntm', 'Drop SIMPLE table (no timing)', -'crtsimple.ntm', 'Create SIMPLE table (no timing)', -# 8192 inserts in 8192 xactions -'inssimple', '8192 INSERTs INTO SIMPLE (8192 xacts)', -'vacuum.ntm', 'Vacuum (no timing)', -# Fast (after table filled with data) index creation test -'crtsimpleidx', 'Create INDEX on SIMPLE', -'drpsimple.ntm', 'Drop SIMPLE table (no timing)', -'crtsimple.ntm', 'Create SIMPLE table (no timing)', -'crtsimpleidx.ntm', 'Create INDEX on SIMPLE (no timing)', -# 8192 inserts in single xaction into table with index -'inssimple T', '8192 INSERTs INTO SIMPLE with INDEX (1 xact)', -# 8192 SELECT * FROM simple WHERE justint = <random_key> in single xaction -'slcsimple T', '8192 random INDEX scans on SIMPLE (1 xact)', -# SELECT * FROM simple ORDER BY justint -'orbsimple', 'ORDER BY SIMPLE', -); + + # It speed up things + 'connection.ntm', 'DB connection startup (no timing)', + + # Just connection startup time (echo "" | psql ... - for PgSQL) + 'connection', 'DB connection startup', + 'crtsimple.ntm', 'Create SIMPLE table (no timing)', + + # 8192 inserts in single xaction + 'inssimple T', '8192 INSERTs INTO SIMPLE (1 xact)', + 'drpsimple.ntm', 'Drop SIMPLE table (no timing)', + 'crtsimple.ntm', 'Create SIMPLE table (no timing)', + + # 8192 inserts in 8192 xactions + 'inssimple', '8192 INSERTs INTO SIMPLE (8192 xacts)', + 'vacuum.ntm', 'Vacuum (no timing)', + + # Fast (after table filled with data) index creation test + 'crtsimpleidx', 'Create INDEX on SIMPLE', + 'drpsimple.ntm', 'Drop SIMPLE table (no timing)', + 'crtsimple.ntm', 'Create SIMPLE table (no timing)', + 'crtsimpleidx.ntm', 'Create INDEX on SIMPLE (no timing)', + + # 8192 inserts in single xaction into table with index + 'inssimple T', '8192 INSERTs INTO SIMPLE with INDEX (1 xact)', + + # 8192 SELECT * FROM simple WHERE justint = <random_key> in single xaction + 'slcsimple T', '8192 random INDEX scans on SIMPLE (1 xact)', + + # SELECT * FROM simple ORDER BY justint + 'orbsimple', 'ORDER BY SIMPLE',); # # It seems that nothing below need to be changed @@ -66,72 +73,76 @@ $DBNAME = 'perftest'; $TestDBMS = $ARGV[0]; die "Unsupported DBMS $TestDBMS\n" if !exists $DBMS{$TestDBMS}; -$FrontEnd = $DBMS{$TestDBMS}[0]; +$FrontEnd = $DBMS{$TestDBMS}[0]; $DestroyDB = $DBMS{$TestDBMS}[1]; -$CreateDB = $DBMS{$TestDBMS}[2]; +$CreateDB = $DBMS{$TestDBMS}[2]; print "(Re)create DataBase $DBNAME\n"; -`$DestroyDB`; # Destroy DB -`$CreateDB`; # Create DB +`$DestroyDB`; # Destroy DB +`$CreateDB`; # Create DB $ResFile = "Results.$TestDBMS"; $TmpFile = "Tmp.$TestDBMS"; -open (SAVEOUT, ">&STDOUT"); -open (STDOUT, ">/dev/null") or die; -open (SAVEERR, ">&STDERR"); -open (STDERR, ">$TmpFile") or die; -select (STDERR); $| = 1; +open(SAVEOUT, ">&STDOUT"); +open(STDOUT, ">/dev/null") or die; +open(SAVEERR, ">&STDERR"); +open(STDERR, ">$TmpFile") or die; +select(STDERR); +$| = 1; for ($i = 0; $i <= $#perftests; $i++) { $test = $perftests[$i]; - ($test, $XACTBLOCK) = split (/ /, $test); + ($test, $XACTBLOCK) = split(/ /, $test); $runtest = $test; - if ( $test =~ /\.ntm/ ) + if ($test =~ /\.ntm/) { + # # No timing for this queries # - close (STDERR); # close $TmpFile - open (STDERR, ">/dev/null") or die; + close(STDERR); # close $TmpFile + open(STDERR, ">/dev/null") or die; $runtest =~ s/\.ntm//; } else { - close (STDOUT); + close(STDOUT); open(STDOUT, ">&SAVEOUT"); print STDOUT "\nRunning: $perftests[$i+1] ..."; - close (STDOUT); - open (STDOUT, ">/dev/null") or die; - select (STDERR); $| = 1; + close(STDOUT); + open(STDOUT, ">/dev/null") or die; + select(STDERR); + $| = 1; printf "$perftests[$i+1]: "; } do "sqls/$runtest"; # Restore STDERR to $TmpFile - if ( $test =~ /\.ntm/ ) + if ($test =~ /\.ntm/) { - close (STDERR); - open (STDERR, ">>$TmpFile") or die; + close(STDERR); + open(STDERR, ">>$TmpFile") or die; } - select (STDERR); $| = 1; + select(STDERR); + $| = 1; $i++; } -close (STDERR); +close(STDERR); open(STDERR, ">&SAVEERR"); -open (TMPF, "<$TmpFile") or die; -open (RESF, ">$ResFile") or die; +open(TMPF, "<$TmpFile") or die; +open(RESF, ">$ResFile") or die; while (<TMPF>) { $str = $_; - ($test, $rtime) = split (/:/, $str); - ($tmp, $rtime, $rest) = split (/[ ]+/, $rtime); + ($test, $rtime) = split(/:/, $str); + ($tmp, $rtime, $rest) = split(/[ ]+/, $rtime); print RESF "$test: $rtime\n"; } |
