diff --git a/test/Performance/README.md b/test/Performance/README.md index deb0e34b..fc27dc13 100644 --- a/test/Performance/README.md +++ b/test/Performance/README.md @@ -22,11 +22,11 @@ PHPBench is used to run the benchmarks. Visit http://phpbench.readthedocs.io/en/ ### 1. Modify lib/connect.php with the test database credentials ### 2. Execute run-perf_tests.py. ### Windows - py.exe run-perf_tests.py -platform -iterations -iterations-large -result-server -result-db -result-uid -result-pwd -iterations -iterations-large -result-server -result-db -result-uid -result-pwd >> run-perf_output.txt ### Linux and Mac On Linux and Mac, the script must be executed with `sudo python3` because to enable pooling it needs to modify odbcinst.ini system file. As an improvement, the location of the odbcinst.ini file can be changed so that, sudo is not requiered. - python3 run-perf_tests.py -platform -iterations -iterations-large -result-server -result-db -result-uid -result-pwd + python3 run-perf_tests.py -platform -iterations -iterations-large -result-server -result-db -result-uid -result-pwd >> run-perf_output.txt `-platform` - The platform that the tests are ran on. Must be one of the following: Windows10, WindowsServer2016 WindowsServer2012 Ubuntu16 RedHat7 Sierra `-iterations` - The number of iterations for regular tests. diff --git a/test/Performance/benchmark/pdo_sqlsrv/regular/PDODeleteBench.php b/test/Performance/benchmark/pdo_sqlsrv/regular/PDODeleteBench.php index b3eb788e..4bd44995 100644 --- a/test/Performance/benchmark/pdo_sqlsrv/regular/PDODeleteBench.php +++ b/test/Performance/benchmark/pdo_sqlsrv/regular/PDODeleteBench.php @@ -28,7 +28,7 @@ class PDODeleteBench{ } public function insertWithPrepare(){ - for( $i=0; $i<1000; $i++ ){ + for( $i=0; $i<100; $i++ ){ PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues ); } } @@ -37,7 +37,7 @@ class PDODeleteBench{ * Note that, every delete calls prepare and execute APIs. */ public function benchDelete(){ - for( $i=0; $i<1000; $i++ ){ + for( $i=0; $i<100; $i++ ){ PDOSqlsrvUtil::deleteWithPrepare( $this->conn, $this->tableName ); } } diff --git a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOFetchBench.php b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOFetchBench.php index e7e17b4d..1d28fcb7 100644 --- a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOFetchBench.php +++ b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOFetchBench.php @@ -35,7 +35,7 @@ class PDOFetchBench{ * Note that, every fetch calls prepare, execute and fetch APIs. */ public function benchFetchWithPrepare(){ - for( $i=0; $i<1000; $i++){ + for( $i=0; $i<100; $i++){ PDOSqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName ); } } diff --git a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOInsertBench.php b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOInsertBench.php index 73b0e191..5610028c 100644 --- a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOInsertBench.php +++ b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOInsertBench.php @@ -30,7 +30,7 @@ class PDOInsertBench{ * Note that, every insertion calls prepare, bindParam and execute APIs. */ public function benchInsertWithPrepare(){ - for ( $i=0; $i<1000; $i++){ + for ( $i=0; $i<100; $i++){ PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues ); } } diff --git a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOSelectVersionBench.php b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOSelectVersionBench.php index 10bc5a77..5de7ec26 100644 --- a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOSelectVersionBench.php +++ b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOSelectVersionBench.php @@ -16,7 +16,9 @@ class PDOSelectVersionBench{ * Each iteration calls execDirect API to fetch @@Version */ public function benchSelectVersion(){ - $version = PDOSqlsrvUtil::selectVersion( $this->conn ); + for( $i=0; $i<10; $i++ ){ + $version = PDOSqlsrvUtil::selectVersion( $this->conn ); + } } public function disconnect(){ diff --git a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOUpdateBench.php b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOUpdateBench.php index 2a582f0b..a590066a 100644 --- a/test/Performance/benchmark/pdo_sqlsrv/regular/PDOUpdateBench.php +++ b/test/Performance/benchmark/pdo_sqlsrv/regular/PDOUpdateBench.php @@ -45,7 +45,7 @@ class PDOUpdateBench{ * Note that, every update calls prepare, bindParam and execute APIs. */ public function benchUpdateWithPrepare(){ - for( $i=0; $i<1000; $i++ ){ + for( $i=0; $i<100; $i++ ){ $stmt = PDOSqlsrvUtil::updateWithPrepare( $this->conn, $this->tableName, $this->updateValues, $this->updateParams ); } } diff --git a/test/Performance/benchmark/sqlsrv/regular/SqlsrvDeleteBench.php b/test/Performance/benchmark/sqlsrv/regular/SqlsrvDeleteBench.php index e47070a5..819fbd91 100644 --- a/test/Performance/benchmark/sqlsrv/regular/SqlsrvDeleteBench.php +++ b/test/Performance/benchmark/sqlsrv/regular/SqlsrvDeleteBench.php @@ -28,7 +28,7 @@ class SqlsrvDeleteBench{ } public function insertWithPrepare(){ - for ( $i=0; $i<1000; $i++ ){ + for ( $i=0; $i<100; $i++ ){ SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues ); } } @@ -37,7 +37,7 @@ class SqlsrvDeleteBench{ * Note that, every delete calls prepare and execute APIs. */ public function benchDelete(){ - for( $i=0; $i<1000; $i++ ){ + for( $i=0; $i<100; $i++ ){ SqlsrvUtil::delete( $this->conn, $this->tableName ); } } diff --git a/test/Performance/benchmark/sqlsrv/regular/SqlsrvFetchBench.php b/test/Performance/benchmark/sqlsrv/regular/SqlsrvFetchBench.php index 035903c2..ddc748cc 100644 --- a/test/Performance/benchmark/sqlsrv/regular/SqlsrvFetchBench.php +++ b/test/Performance/benchmark/sqlsrv/regular/SqlsrvFetchBench.php @@ -38,7 +38,7 @@ class SqlsrvFetchBench{ * Note that, every fetch calls prepare, execute and fetch APIs. */ public function benchFetchWithPrepare(){ - for( $i=0; $i<1000; $i++){ + for( $i=0; $i<100; $i++){ SqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName ); } } diff --git a/test/Performance/benchmark/sqlsrv/regular/SqlsrvInsertBench.php b/test/Performance/benchmark/sqlsrv/regular/SqlsrvInsertBench.php index 43a451fd..2e67c2a7 100644 --- a/test/Performance/benchmark/sqlsrv/regular/SqlsrvInsertBench.php +++ b/test/Performance/benchmark/sqlsrv/regular/SqlsrvInsertBench.php @@ -31,7 +31,7 @@ class SqlsrvInsertBench{ * Note that, every insertion calls prepare, bindParam and execute APIs. */ public function benchInsertWithPrepare(){ - for( $i=0; $i<1000; $i++ ){ + for( $i=0; $i<100; $i++ ){ SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues ); } } diff --git a/test/Performance/benchmark/sqlsrv/regular/SqlsrvSelectVersionBench.php b/test/Performance/benchmark/sqlsrv/regular/SqlsrvSelectVersionBench.php index 9567a093..3d7a282f 100644 --- a/test/Performance/benchmark/sqlsrv/regular/SqlsrvSelectVersionBench.php +++ b/test/Performance/benchmark/sqlsrv/regular/SqlsrvSelectVersionBench.php @@ -16,7 +16,9 @@ class SqlsrvSelectVersionBench{ * Each iteration calls execDirect API to fetch @@Version */ public function benchSelectVersion(){ - $version = SqlsrvUtil::selectVersion( $this->conn ); + for( $i=0; $i<10; $i++ ){ + $version = SqlsrvUtil::selectVersion( $this->conn ); + } } public function disconnect(){ diff --git a/test/Performance/benchmark/sqlsrv/regular/SqlsrvUpdateBench.php b/test/Performance/benchmark/sqlsrv/regular/SqlsrvUpdateBench.php index 806c336a..51e1f2a0 100644 --- a/test/Performance/benchmark/sqlsrv/regular/SqlsrvUpdateBench.php +++ b/test/Performance/benchmark/sqlsrv/regular/SqlsrvUpdateBench.php @@ -45,7 +45,7 @@ class SqlsrvUpdateBench{ * Note that, every update calls prepare, bindParam and execute APIs. */ public function benchUpdateWithPrepare(){ - for( $i=0; $i<1000; $i++ ){ + for( $i=0; $i<100; $i++ ){ $stmt = SqlsrvUtil::updateWithPrepare( $this->conn, $this->tableName, $this->updateValues, $this->updateParams ); } }