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
|
||||
### 2. Execute run-perf_tests.py.
|
||||
### 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
|
||||
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
|
||||
`-iterations` - The number of iterations for regular tests.
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,10 @@ class PDOSelectVersionBench{
|
|||
* Each iteration calls execDirect API to fetch @@Version
|
||||
*/
|
||||
public function benchSelectVersion(){
|
||||
for( $i=0; $i<10; $i++ ){
|
||||
$version = PDOSqlsrvUtil::selectVersion( $this->conn );
|
||||
}
|
||||
}
|
||||
|
||||
public function disconnect(){
|
||||
PDOSqlsrvUtil::disconnect( $this->conn );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,8 +16,10 @@ class SqlsrvSelectVersionBench{
|
|||
* Each iteration calls execDirect API to fetch @@Version
|
||||
*/
|
||||
public function benchSelectVersion(){
|
||||
for( $i=0; $i<10; $i++ ){
|
||||
$version = SqlsrvUtil::selectVersion( $this->conn );
|
||||
}
|
||||
}
|
||||
|
||||
public function disconnect(){
|
||||
SqlsrvUtil::disconnect( $this->conn );
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue