change the number of CRUD performed per iteration
This commit is contained in:
parent
a0def0a1aa
commit
566cd2c021
|
@ -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
|
### 1. Modify lib/connect.php with the test database credentials
|
||||||
### 2. Execute run-perf_tests.py.
|
### 2. Execute run-perf_tests.py.
|
||||||
### Windows
|
### Windows
|
||||||
py.exe run-perf_tests.py -platform <PLATFORM> -iterations <ITERATIONS> -iterations-large <ITERATIONS_LARGE> -result-server <RESULT_SERVER> -result-db <RESULT_DB> -result-uid <RESULT_UID> -result-pwd <RESULT_PWD
|
py.exe run-perf_tests.py -platform <PLATFORM> -iterations <ITERATIONS> -iterations-large <ITERATIONS_LARGE> -result-server <RESULT_SERVER> -result-db <RESULT_DB> -result-uid <RESULT_UID> -result-pwd <RESULT_PWD> >> run-perf_output.txt
|
||||||
### Linux and Mac
|
### 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.
|
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 <PLATFORM> -iterations <ITERATIONS> -iterations-large <ITERATIONS_LARGE> -result-server <RESULT_SERVER> -result-db <RESULT_DB> -result-uid <RESULT_UID> -result-pwd <RESULT_PWD>
|
python3 run-perf_tests.py -platform <PLATFORM> -iterations <ITERATIONS> -iterations-large <ITERATIONS_LARGE> -result-server <RESULT_SERVER> -result-db <RESULT_DB> -result-uid <RESULT_UID> -result-pwd <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
|
`-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.
|
`-iterations` - The number of iterations for regular tests.
|
||||||
|
|
|
@ -28,7 +28,7 @@ class PDODeleteBench{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function insertWithPrepare(){
|
public function insertWithPrepare(){
|
||||||
for( $i=0; $i<1000; $i++ ){
|
for( $i=0; $i<100; $i++ ){
|
||||||
PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
|
PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ class PDODeleteBench{
|
||||||
* Note that, every delete calls prepare and execute APIs.
|
* Note that, every delete calls prepare and execute APIs.
|
||||||
*/
|
*/
|
||||||
public function benchDelete(){
|
public function benchDelete(){
|
||||||
for( $i=0; $i<1000; $i++ ){
|
for( $i=0; $i<100; $i++ ){
|
||||||
PDOSqlsrvUtil::deleteWithPrepare( $this->conn, $this->tableName );
|
PDOSqlsrvUtil::deleteWithPrepare( $this->conn, $this->tableName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ class PDOFetchBench{
|
||||||
* Note that, every fetch calls prepare, execute and fetch APIs.
|
* Note that, every fetch calls prepare, execute and fetch APIs.
|
||||||
*/
|
*/
|
||||||
public function benchFetchWithPrepare(){
|
public function benchFetchWithPrepare(){
|
||||||
for( $i=0; $i<1000; $i++){
|
for( $i=0; $i<100; $i++){
|
||||||
PDOSqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
|
PDOSqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ class PDOInsertBench{
|
||||||
* Note that, every insertion calls prepare, bindParam and execute APIs.
|
* Note that, every insertion calls prepare, bindParam and execute APIs.
|
||||||
*/
|
*/
|
||||||
public function benchInsertWithPrepare(){
|
public function benchInsertWithPrepare(){
|
||||||
for ( $i=0; $i<1000; $i++){
|
for ( $i=0; $i<100; $i++){
|
||||||
PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
|
PDOSqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,9 @@ class PDOSelectVersionBench{
|
||||||
* Each iteration calls execDirect API to fetch @@Version
|
* Each iteration calls execDirect API to fetch @@Version
|
||||||
*/
|
*/
|
||||||
public function benchSelectVersion(){
|
public function benchSelectVersion(){
|
||||||
$version = PDOSqlsrvUtil::selectVersion( $this->conn );
|
for( $i=0; $i<10; $i++ ){
|
||||||
|
$version = PDOSqlsrvUtil::selectVersion( $this->conn );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function disconnect(){
|
public function disconnect(){
|
||||||
|
|
|
@ -45,7 +45,7 @@ class PDOUpdateBench{
|
||||||
* Note that, every update calls prepare, bindParam and execute APIs.
|
* Note that, every update calls prepare, bindParam and execute APIs.
|
||||||
*/
|
*/
|
||||||
public function benchUpdateWithPrepare(){
|
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 );
|
$stmt = PDOSqlsrvUtil::updateWithPrepare( $this->conn, $this->tableName, $this->updateValues, $this->updateParams );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,7 +28,7 @@ class SqlsrvDeleteBench{
|
||||||
}
|
}
|
||||||
|
|
||||||
public function insertWithPrepare(){
|
public function insertWithPrepare(){
|
||||||
for ( $i=0; $i<1000; $i++ ){
|
for ( $i=0; $i<100; $i++ ){
|
||||||
SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
|
SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@ class SqlsrvDeleteBench{
|
||||||
* Note that, every delete calls prepare and execute APIs.
|
* Note that, every delete calls prepare and execute APIs.
|
||||||
*/
|
*/
|
||||||
public function benchDelete(){
|
public function benchDelete(){
|
||||||
for( $i=0; $i<1000; $i++ ){
|
for( $i=0; $i<100; $i++ ){
|
||||||
SqlsrvUtil::delete( $this->conn, $this->tableName );
|
SqlsrvUtil::delete( $this->conn, $this->tableName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class SqlsrvFetchBench{
|
||||||
* Note that, every fetch calls prepare, execute and fetch APIs.
|
* Note that, every fetch calls prepare, execute and fetch APIs.
|
||||||
*/
|
*/
|
||||||
public function benchFetchWithPrepare(){
|
public function benchFetchWithPrepare(){
|
||||||
for( $i=0; $i<1000; $i++){
|
for( $i=0; $i<100; $i++){
|
||||||
SqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
|
SqlsrvUtil::fetchWithPrepare( $this->conn, $this->tableName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ class SqlsrvInsertBench{
|
||||||
* Note that, every insertion calls prepare, bindParam and execute APIs.
|
* Note that, every insertion calls prepare, bindParam and execute APIs.
|
||||||
*/
|
*/
|
||||||
public function benchInsertWithPrepare(){
|
public function benchInsertWithPrepare(){
|
||||||
for( $i=0; $i<1000; $i++ ){
|
for( $i=0; $i<100; $i++ ){
|
||||||
SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
|
SqlsrvUtil::insertWithPrepare( $this->conn, $this->tableName, $this->insertValues );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,9 @@ class SqlsrvSelectVersionBench{
|
||||||
* Each iteration calls execDirect API to fetch @@Version
|
* Each iteration calls execDirect API to fetch @@Version
|
||||||
*/
|
*/
|
||||||
public function benchSelectVersion(){
|
public function benchSelectVersion(){
|
||||||
$version = SqlsrvUtil::selectVersion( $this->conn );
|
for( $i=0; $i<10; $i++ ){
|
||||||
|
$version = SqlsrvUtil::selectVersion( $this->conn );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function disconnect(){
|
public function disconnect(){
|
||||||
|
|
|
@ -45,7 +45,7 @@ class SqlsrvUpdateBench{
|
||||||
* Note that, every update calls prepare, bindParam and execute APIs.
|
* Note that, every update calls prepare, bindParam and execute APIs.
|
||||||
*/
|
*/
|
||||||
public function benchUpdateWithPrepare(){
|
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 );
|
$stmt = SqlsrvUtil::updateWithPrepare( $this->conn, $this->tableName, $this->updateValues, $this->updateParams );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue