10
10
# Author : Sergey Dryabzhinsky #
11
11
# Company : Rusoft Ltd, Russia #
12
12
# Date : Jun 7, 2025 #
13
- # Version : 1.0.65 #
13
+ # Version : 1.0.66 #
14
14
# License : Creative Commons CC-BY license #
15
15
# Website : https://github.com/rusoft/php-simple-benchmark-script #
16
16
# Website : https://gitea.rusoft.ru/open-source/php-simple-benchmark-script #
20
20
21
21
include_once ("php-options.php " );
22
22
23
- $ scriptVersion = '1.0.65 ' ;
23
+ $ scriptVersion = '1.0.66 ' ;
24
24
25
25
// Special string to flush buffers, nginx for example
26
26
$ flushStr = '<!-- ' .str_repeat ("" , 8192 ).' --> ' ;
134
134
if (file_exists ('kvstorage-redis.inc ' ) && extension_loaded ('redis ' )) {
135
135
@include_once ("kv-redis.inc " );
136
136
}
137
+ if (file_exists ('kvstorage-pgsql.inc ' ) && extension_loaded ('pgsql ' )) {
138
+ @include_once ("kv-pgsql.inc " );
139
+ }
140
+ if (file_exists ('kvstorage-mysql.inc ' ) && extension_loaded ('mysql ' )) {
141
+ @include_once ("kv-mysql-myisam.inc " );
142
+ @include_once ("kv-mysql-innodb.inc " );
143
+ @include_once ("kv-mysql-memory.inc " );
144
+ }
145
+ if (file_exists ('kvstorage-mysqli.inc ' ) && extension_loaded ('mysqli ' )) {
146
+ @include_once ("kv-mysqli-myisam.inc " );
147
+ @include_once ("kv-mysqli-innodb.inc " );
148
+ @include_once ("kv-mysqli-memory.inc " );
149
+ }
137
150
}// php>=5.0
138
151
if ( PHP_VERSION >= '5.3.0 ' ) {
139
152
if (file_exists ('kvstorage-sqlite3.inc ' ) && extension_loaded ('sqlite3 ' )) {
@@ -734,22 +747,22 @@ function gethostname() {
734
747
$ loopMaxPhpTimesMHz = 3500 ;
735
748
// How much time needed for tests on this machine
736
749
$ loopMaxPhpTimes = array (
737
- '4.4 ' => 2099 ,
738
- '5.2 ' => 839 ,
739
- '5.3 ' => 1235 ,
740
- '5.4 ' => 1510 ,
741
- '5.5 ' => 802 ,
742
- '5.6 ' => 1337 ,
743
- '7.0 ' => 672 ,
744
- '7.1 ' => 669 ,
745
- '7.2 ' => 662 ,
746
- '7.3 ' => 586 ,
747
- '7.4 ' => 659 ,
748
- '8.0 ' => 676 ,
749
- '8.1 ' => 450 ,
750
- '8.2 ' => 427 ,
751
- '8.3 ' => 582 ,
752
- '8.4 ' => 529
750
+ '4.4 ' => 1117 ,
751
+ '5.2 ' => 1210 ,
752
+ '5.3 ' => 2259 ,
753
+ '5.4 ' => 4155 ,
754
+ '5.5 ' => 4588 ,
755
+ '5.6 ' => 4481 ,
756
+ '7.0 ' => 3224 ,
757
+ '7.1 ' => 3288 ,
758
+ '7.2 ' => 2974 ,
759
+ '7.3 ' => 3451 ,
760
+ '7.4 ' => 3065 ,
761
+ '8.0 ' => 3198 ,
762
+ '8.1 ' => 4099 ,
763
+ '8.2 ' => 2971 ,
764
+ '8.3 ' => 3001 ,
765
+ '8.4 ' => 4535
753
766
);
754
767
// Simple and fast test times, used to adjust all test times and limits
755
768
$ dumbTestMaxPhpTimes = array (
@@ -792,6 +805,7 @@ function gethostname() {
792
805
'12_igb_unserialize ' => 1300000 ,
793
806
'11_msgpack_pack ' => 1300000 ,
794
807
'12_msgpack_unpack ' => 1300000 ,
808
+ '13_array_fill ' => 250 ,
795
809
'13_array_loop ' => 250 ,
796
810
'14_array_loop ' => 250 ,
797
811
'15_clean_loops ' => 200000000 ,
@@ -819,10 +833,10 @@ function gethostname() {
819
833
'36_01_zlib_deflate_compress ' => 500000 ,
820
834
'36_02_zlib_gzip_compress ' => 500000 ,
821
835
'36_bzip2_compress ' => 50000 ,
822
- '36_lz4_compress ' => 5000000 ,
823
- '36_snappy_compress ' => 5000000 ,
824
- '36_zstd_compress ' => 5000000 ,
825
- '36_brotli_compress ' => 1000000 ,
836
+ '36_lz4_compress ' => 500000 ,
837
+ '36_snappy_compress ' => 500000 ,
838
+ '36_zstd_compress ' => 500000 ,
839
+ '36_brotli_compress ' => 100000 ,
826
840
'37_01_php8_str_contains ' => 100000 ,
827
841
'37_02_php8_str_contains_emulate ' => 100000 ,
828
842
'38_01_php_uuid ' => 1000000 ,
@@ -846,6 +860,13 @@ function gethostname() {
846
860
'42_ctype_isdigit ' => 10000000 ,
847
861
'43_iconv_translit ' => 10000000 ,
848
862
'44_session_time ' => 100000 ,
863
+ '45_01_kvs_mysql_myisam ' => 1000000 ,
864
+ '45_02_kvs_mysql_innodb ' => 1000000 ,
865
+ '45_03_kvs_mysql_memory ' => 1000000 ,
866
+ '46_01_kvs_mysqli_myisam ' => 1000000 ,
867
+ '46_02_kvs_mysqli_innodb ' => 1000000 ,
868
+ '46_03_kvs_mysqli_memory ' => 1000000 ,
869
+ '47_kvs_pgsql ' => 100000 ,
849
870
);
850
871
// Should not be more than X Mb
851
872
// Different PHP could use different amount of memory
@@ -868,7 +889,8 @@ function gethostname() {
868
889
'11_igb_serialize ' => 4 ,
869
890
'12_igb_unserialize ' => 4 ,
870
891
// php-5.3
871
- '13_array_loop ' => 54 ,
892
+ '13_array_fill ' => 55 ,
893
+ '13_array_loop ' => 61 ,
872
894
'14_array_loop ' => 62 ,
873
895
// opcache, php-7.4
874
896
'15_clean_loops ' => 14 ,
@@ -923,6 +945,13 @@ function gethostname() {
923
945
'42_ctype_isdigit ' => 4 ,
924
946
'43_iconv_translit ' => 4 ,
925
947
'44_session_time ' => 4 ,
948
+ '45_01_kvs_mysql_myisam ' => 4 ,
949
+ '45_02_kvs_mysql_innodb ' => 4 ,
950
+ '45_03_kvs_mysql_memory ' => 4 ,
951
+ '46_01_kvs_mysqli_myisam ' => 4 ,
952
+ '46_02_kvs_mysqli_innodb ' => 4 ,
953
+ '46_03_kvs_mysqli_memory ' => 4 ,
954
+ '47_kvs_pgsql ' => 4 ,
926
955
);
927
956
928
957
/** ---------------------------------- Common functions -------------------------------------------- */
@@ -1753,6 +1782,30 @@ function filter_out_name_by_pattern($key)
1753
1782
if ($ v ) define ('REDIS_VERSION ' ,$ v );
1754
1783
else define ('REDIS_VERSION ' ,'-.-.- ' );
1755
1784
}
1785
+ $ has_mysql = "{$ colorYellow }no {$ colorReset }" ;
1786
+ if (extension_loaded ('mysql ' )) {
1787
+ $ has_mysql = "{$ colorGreen }yes {$ colorReset }" ;
1788
+ include_once ('mysql.inc ' );
1789
+ $ v =get_mysql_version ();
1790
+ if ($ v ) define ('MYSQL_VERSION ' ,$ v );
1791
+ else define ('MYSQL_VERSION ' ,'-.-.- ' );
1792
+ }
1793
+ $ has_pgsql = "{$ colorYellow }no {$ colorReset }" ;
1794
+ if (extension_loaded ('pgsql ' )) {
1795
+ $ has_pgsql = "{$ colorGreen }yes {$ colorReset }" ;
1796
+ include_once ('pgsql.inc ' );
1797
+ $ v =get_pgsql_version ();
1798
+ if ($ v ) define ('PGSQL_VERSION ' ,$ v );
1799
+ else define ('PGSQL_VERSION ' ,'-.-.- ' );
1800
+ }
1801
+ $ has_mysqli = "{$ colorYellow }no {$ colorReset }" ;
1802
+ if (extension_loaded ('mysqli ' )) {
1803
+ $ has_mysqli = "{$ colorGreen }yes {$ colorReset }" ;
1804
+ include_once ('mysqli.inc ' );
1805
+ $ v =get_mysqli_version ();
1806
+ if ($ v ) define ('MYSQLI_VERSION ' ,$ v );
1807
+ else define ('MYSQLI_VERSION ' ,'-.-.- ' );
1808
+ }
1756
1809
$ has_sqlite3 = "{$ colorYellow }no {$ colorReset }" ;
1757
1810
if (extension_loaded ('sqlite3 ' )) {
1758
1811
$ has_sqlite3 = "{$ colorGreen }yes {$ colorReset }" ;
@@ -1882,10 +1935,14 @@ function filter_out_name_by_pattern($key)
1882
1935
}
1883
1936
1884
1937
if (!defined ('PCRE_VERSION ' )) define ('PCRE_VERSION ' , '-.-- ' );
1938
+ if (!defined ('ICONV_VERSION ' )) define ('ICONV_VERSION ' , '-.-- ' );
1885
1939
if (!defined ('ZLIB_VERSION ' )) define ('ZLIB_VERSION ' , '-.-.- ' );
1886
1940
if (!defined ('MEMCACHE_VERSION ' )) define ('MEMCACHE_VERSION ' , '-.-.- ' );
1887
1941
if (!defined ('REDIS_VERSION ' )) define ('REDIS_VERSION ' , '-.-.- ' );
1888
1942
if (!defined ('SQLITE3_VERSION ' )) define ('SQLITE3_VERSION ' , '-.-.- ' );
1943
+ if (!defined ('MYSQL_VERSION ' )) define ('MYSQL_VERSION ' , '-.-.- ' );
1944
+ if (!defined ('PGSQL_VERSION ' )) define ('PGSQL_VERSION ' , '-.-.- ' );
1945
+ if (!defined ('MYSQLI_VERSION ' )) define ('MYSQLI_VERSION ' , '-.-.- ' );
1889
1946
if (!defined ('LIBXML_DOTTED_VERSION ' )) define ('LIBXML_DOTTED_VERSION ' , '-.-.- ' );
1890
1947
if (!defined ('SODIUM_LIBRARY_VERSION ' )) define ('SODIUM_LIBRARY_VERSION ' , '-.-.- ' );
1891
1948
if (!defined ('INTL_ICU_VERSION ' )) define ('INTL_ICU_VERSION ' , '-.- ' );
@@ -1901,7 +1958,7 @@ function print_results_common()
1901
1958
global $ has_gd , $ has_gdgif , $ has_gdpng , $ has_gdjpg , $ has_gdwebp , $ has_gdavif ;
1902
1959
global $ has_imagick , $ has_igb , $ has_msg , $ has_jsond , $ has_jsond_as_json , $ has_ctype , $ has_iconv , $ has_session ;
1903
1960
global $ has_zlib , $ has_uuid , $ has_gzip , $ has_bz2 , $ has_lz4 , $ has_snappy , $ has_zstd , $ has_brotli ;
1904
- global $ has_apcu , $ has_shmop , $ has_memcache , $ has_redis , $ has_sodium , $ has_sqlite3 , $ opcache , $ has_eacc , $ has_xdebug , $ xcache , $ apcache , $ eaccel , $ xdebug , $ xdbg_mode , $ obd_set , $ mbover ;
1961
+ global $ has_apcu , $ has_shmop , $ has_memcache , $ has_redis , $ has_mysql , $ has_pgsql , $ has_mysqli , $ has_sodium , $ has_sqlite3 , $ opcache , $ has_eacc , $ has_xdebug , $ xcache , $ apcache , $ eaccel , $ xdebug , $ xdbg_mode , $ obd_set , $ mbover ;
1905
1962
global $ showOnlySystemInfo , $ padLabel , $ functions , $ runOnlySelectedTests , $ selectedTests , $ totalOps ;
1906
1963
global $ colorGreen , $ colorReset , $ colorRed ;
1907
1964
@@ -1934,7 +1991,7 @@ function print_results_common()
1934
1991
. str_pad ("simplexml " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_simplexml; libxml version: " .LIBXML_DOTTED_VERSION ."\n"
1935
1992
. str_pad ("dom " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_dom \n"
1936
1993
. str_pad ("ctype " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_ctype \n"
1937
- . str_pad ("iconv " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_iconv \n"
1994
+ . str_pad ("iconv " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_iconv; version: " . ICONV_VERSION . " \n"
1938
1995
. str_pad ("session " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_session \n"
1939
1996
. str_pad ("intl " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_intl " . ($ has_intl == "{$ colorGreen }yes {$ colorReset }" ? '; icu version: ' . INTL_ICU_VERSION : '' )."\n"
1940
1997
. str_pad ("-optional-> " , $ padInfo , '' , STR_PAD_LEFT ) . "\n"
@@ -1944,11 +2001,14 @@ function print_results_common()
1944
2001
. str_pad ("\t- JPG " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_gdjpg " ."\n"
1945
2002
. str_pad ("\t- WEBP " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_gdwebp " ."\n"
1946
2003
. str_pad ("\t- AVIF " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_gdavif " ."\n"
1947
- . str_pad ("imagick " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_imagick: version: " .IMG_VERSION ."\n"
1948
- . str_pad ("apcu " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_apcu; \n"
2004
+ . str_pad ("imagick " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_imagick: version: " .IMG_VERSION ."; \n"
2005
+ . str_pad ("apcu " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_apcu \n"
1949
2006
. str_pad ("shmop " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_shmop \n"
1950
2007
. str_pad ("memcache " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_memcache, version: " .MEMCACHE_VERSION ."; \n"
1951
2008
. str_pad ("redis " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_redis, version: " .REDIS_VERSION ."; \n"
2009
+ . str_pad ("mysql " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_mysql, version: " .MYSQL_VERSION ."; \n"
2010
+ . str_pad ("pgsql " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_pgsql, version: " .PGSQL_VERSION ."; \n"
2011
+ . str_pad ("mysqli " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_mysqli, version: " .MYSQLI_VERSION ."; \n"
1952
2012
. str_pad ("sqlite3 " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_sqlite3, version: " .SQLITE3_VERSION ."; \n"
1953
2013
. str_pad ("sodium " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_sodium, version: " .SODIUM_LIBRARY_VERSION ."; \n"
1954
2014
. str_pad ("-alternative-> " , $ padInfo , '' , STR_PAD_LEFT ) . "\n"
@@ -1962,7 +2022,7 @@ function print_results_common()
1962
2022
. str_pad ("bz2 " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_bz2 \n"
1963
2023
. str_pad ("lz4 " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_lz4 \n"
1964
2024
. str_pad ("snappy " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_snappy \n"
1965
- . str_pad ("zstd " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_zstd, version: " .LIBZSTD_VERSION_STRING ."\n"
2025
+ . str_pad ("zstd " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_zstd, version: " .LIBZSTD_VERSION_STRING ."; \n"
1966
2026
. str_pad ("brotli " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_brotli \n"
1967
2027
. str_pad ("uuid " , $ padInfo , '' , STR_PAD_LEFT ) . " : $ has_uuid \n"
1968
2028
. str_pad ("-affecting-> " , $ padInfo , '' , STR_PAD_LEFT ) . "\n"
0 commit comments