10
10
# Author : Sergey Dryabzhinsky #
11
11
# Company : Rusoft Ltd, Russia #
12
12
# Date : Jun 4, 2025 #
13
- # Version : 1.0.63 #
13
+ # Version : 1.0.64-dev #
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.63 ' ;
23
+ $ scriptVersion = '1.0.64-dev ' ;
24
24
25
25
// Special string to flush buffers, nginx for example
26
26
$ flushStr = '<!-- ' .str_repeat (" " , 8192 ).' --> ' ;
102
102
if (extension_loaded ('intl ' )) {
103
103
@include_once ("intl.inc " );
104
104
}
105
+ if (extension_loaded ('ctype ' )) {
106
+ @include_once ("mod-ctype-isdigit.inc " );
107
+ }
105
108
if (file_exists ('UUID.php ' ) && PHP_VERSION >= '5.0.0 ' ) {
106
109
@include_once ("php-uuid.inc " );
107
110
}
125
128
if (file_exists ('kvstorage-redis.inc ' ) && extension_loaded ('redis ' )) {
126
129
@include_once ("kv-redis.inc " );
127
130
}
131
+ }// php>=5.0
132
+ if ( PHP_VERSION >= '5.3.0 ' ) {
128
133
if (file_exists ('kvstorage-sqlite3.inc ' ) && extension_loaded ('sqlite3 ' )) {
129
134
@include_once ("kv-sqlite3-generic-file.inc " );
130
135
@include_once ("kv-sqlite3-devshm-file.inc " );
131
136
@include_once ("kv-sqlite3-memory-file.inc " );
132
137
}
133
- }// php>=5.0
138
+ }// php>=5.3
139
+ if ( PHP_VERSION >= '7.2.0 ' ) {
140
+ if (file_exists ('mod-sodium.inc ' ) && extension_loaded ('sodium ' )) {
141
+ @include_once ("mod-sodium.inc " );
142
+ }
143
+ }// php>=5.3
134
144
135
145
if (extension_loaded ('uuid ' )) {
136
146
@include_once ("mod-uuid.inc " );
@@ -715,25 +725,25 @@ function gethostname() {
715
725
/** ---------------------------------- Tests limits - to recalculate -------------------------------------------- */
716
726
717
727
// Gathered on this machine
718
- $ loopMaxPhpTimesMHz = 3800 ;
728
+ $ loopMaxPhpTimesMHz = 3500 ;
719
729
// How much time needed for tests on this machine
720
730
$ loopMaxPhpTimes = array (
721
- '4.4 ' => 324 ,
722
- '5.2 ' => 248 ,
723
- '5.3 ' => 211 ,
724
- '5.4 ' => 199 ,
725
- '5.5 ' => 200 ,
726
- '5.6 ' => 204 ,
727
- '7.0 ' => 106 ,
728
- '7.1 ' => 104 ,
729
- '7.2 ' => 98 ,
730
- '7.3 ' => 89 ,
731
- '7.4 ' => 89 ,
732
- '8.0 ' => 83 ,
733
- '8.1 ' => 82 ,
734
- '8.2 ' => 79 ,
735
- '8.3 ' => 77 ,
736
- '8.4 ' => 77
731
+ '4.4 ' => 1456 ,
732
+ '5.2 ' => 839 ,
733
+ '5.3 ' => 1235 ,
734
+ '5.4 ' => 1510 ,
735
+ '5.5 ' => 802 ,
736
+ '5.6 ' => 1337 ,
737
+ '7.0 ' => 672 ,
738
+ '7.1 ' => 669 ,
739
+ '7.2 ' => 662 ,
740
+ '7.3 ' => 586 ,
741
+ '7.4 ' => 659 ,
742
+ '8.0 ' => 676 ,
743
+ '8.1 ' => 450 ,
744
+ '8.2 ' => 427 ,
745
+ '8.3 ' => 582 ,
746
+ '8.4 ' => 736
737
747
);
738
748
// Simple and fast test times, used to adjust all test times and limits
739
749
$ dumbTestMaxPhpTimes = array (
@@ -807,8 +817,8 @@ function gethostname() {
807
817
'36_snappy_compress ' => 5000000 ,
808
818
'36_zstd_compress ' => 5000000 ,
809
819
'36_brotli_compress ' => 1000000 ,
810
- '37_01_php8_str_ccontains ' => 100000 ,
811
- '37_02_php8_str_ccontains_simulate ' => 100000 ,
820
+ '37_01_php8_str_contains ' => 100000 ,
821
+ '37_02_php8_str_contains_emulate ' => 100000 ,
812
822
'38_01_php_uuid ' => 1000000 ,
813
823
'38_02_mod_uuid ' => 1000000 ,
814
824
'39_01_kvstorage_memory ' => 500000 ,
@@ -825,6 +835,9 @@ function gethostname() {
825
835
'40_03_gd_save_fill_empty_jpg ' => 10000 ,
826
836
'40_04_gd_save_fill_empty_webp ' => 10000 ,
827
837
'40_05_gd_save_fill_empty_avif ' => 10000 ,
838
+ '41_01_sodium_string_num_int ' => 10000000 ,
839
+ '41_02_sodium_string_num_float ' => 10000000 ,
840
+ '42_ctype_isdigit ' => 10000000 ,
828
841
);
829
842
// Should not be more than X Mb
830
843
// Different PHP could use different amount of memory
@@ -879,8 +892,8 @@ function gethostname() {
879
892
'36_snappy_compress ' => 4 ,
880
893
'36_zstd_compress ' => 4 ,
881
894
'36_brotli_compress ' => 4 ,
882
- '37_01_php8_str_ccontains ' => 4 ,
883
- '37_02_php8_str_ccontains_simulate ' => 4 ,
895
+ '37_01_php8_str_contains ' => 4 ,
896
+ '37_02_php8_str_contains_simulate ' => 4 ,
884
897
'38_01_php_uuid ' => 4 ,
885
898
'38_02_mod_uuid ' => 4 ,
886
899
'39_01_kvstorage_memory ' => 3 ,
@@ -897,6 +910,9 @@ function gethostname() {
897
910
'40_03_gd_save_fill_empty_jpg ' => 4 ,
898
911
'40_04_gd_save_fill_empty_webp ' => 4 ,
899
912
'40_05_gd_save_fill_empty_avif ' => 4 ,
913
+ '41_01_sodium_string_num_int ' => 4 ,
914
+ '41_02_sodium_string_num_float ' => 4 ,
915
+ '42_ctype_isdigit ' => 4 ,
900
916
);
901
917
902
918
/** ---------------------------------- Common functions -------------------------------------------- */
@@ -1707,6 +1723,10 @@ function filter_out_name_by_pattern($key)
1707
1723
if (extension_loaded ('shmop ' )) {
1708
1724
$ has_shmop = "{$ colorGreen }yes {$ colorReset }" ;
1709
1725
}
1726
+ $ has_sodium = "{$ colorYellow }no {$ colorReset }" ;
1727
+ if (extension_loaded ('sodium ' )) {
1728
+ $ has_sodium = "{$ colorGreen }yes {$ colorReset }" ;
1729
+ }
1710
1730
$ has_memcache = "{$ colorYellow }no {$ colorReset }" ;
1711
1731
if (extension_loaded ('memcache ' )) {
1712
1732
$ has_memcache = "{$ colorGreen }yes {$ colorReset }" ;
@@ -1796,6 +1816,10 @@ function filter_out_name_by_pattern($key)
1796
1816
if (extension_loaded ('intl ' )) {
1797
1817
$ has_intl = "{$ colorGreen }yes {$ colorReset }" ;
1798
1818
}
1819
+ $ has_ctype = "{$ colorYellow }no {$ colorReset }" ;
1820
+ if (extension_loaded ('ctype ' )) {
1821
+ $ has_ctype = "{$ colorGreen }yes {$ colorReset }" ;
1822
+ }
1799
1823
$ has_zlib = "{$ colorYellow }no {$ colorReset }" ;
1800
1824
$ has_gzip = "{$ colorYellow }no {$ colorReset }" ;
1801
1825
if (extension_loaded ('zlib ' )) {
@@ -1845,6 +1869,7 @@ function filter_out_name_by_pattern($key)
1845
1869
if (!defined ('REDIS_VERSION ' )) define ('REDIS_VERSION ' , '-.-- ' );
1846
1870
if (!defined ('SQLITE3_VERSION ' )) define ('SQLITE3_VERSION ' , '-.-- ' );
1847
1871
if (!defined ('LIBXML_DOTTED_VERSION ' )) define ('LIBXML_DOTTED_VERSION ' , '-.-.- ' );
1872
+ if (!defined ('SODIUM_LIBRARY_VERSION ' )) define ('SODIUM_LIBRARY_VERSION ' , '-.-.- ' );
1848
1873
if (!defined ('INTL_ICU_VERSION ' )) define ('INTL_ICU_VERSION ' , '-.- ' );
1849
1874
if (!defined ('LIBZSTD_VERSION_STRING ' )) define ('LIBZSTD_VERSION_STRING ' , '-.-.- ' );
1850
1875
@@ -1856,9 +1881,9 @@ function print_results_common()
1856
1881
global $ line , $ padHeader , $ cpuInfo , $ padInfo , $ scriptVersion , $ maxTime , $ originTimeLimit , $ originMemoryLimit , $ cryptAlgoName , $ memoryLimitMb ;
1857
1882
global $ flushStr , $ has_apc , $ has_pcre , $ has_intl , $ has_json , $ has_simplexml , $ has_dom , $ has_mbstring , $ has_opcache , $ has_xcache ;
1858
1883
global $ has_gd , $ has_gdgif , $ has_gdpng , $ has_gdjpg , $ has_gdwebp , $ has_gdavif ;
1859
- global $ has_imagick , $ has_igb , $ has_msg , $ has_jsond , $ has_jsond_as_json ;
1884
+ global $ has_imagick , $ has_igb , $ has_msg , $ has_jsond , $ has_jsond_as_json, $ has_ctype ;
1860
1885
global $ has_zlib , $ has_uuid , $ has_gzip , $ has_bz2 , $ has_lz4 , $ has_snappy , $ has_zstd , $ has_brotli ;
1861
- global $ has_apcu , $ has_shmop , $ has_memcache , $ has_redis , $ has_sqlite3 , $ opcache , $ has_eacc , $ has_xdebug , $ xcache , $ apcache , $ eaccel , $ xdebug , $ xdbg_mode , $ obd_set , $ mbover ;
1886
+ 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 ;
1862
1887
global $ showOnlySystemInfo , $ padLabel , $ functions , $ runOnlySelectedTests , $ selectedTests , $ totalOps ;
1863
1888
global $ colorGreen , $ colorReset , $ colorRed ;
1864
1889
@@ -1890,6 +1915,7 @@ function print_results_common()
1890
1915
. str_pad ("pcre " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_pcre " . ($ has_pcre == "{$ colorGreen }yes {$ colorReset }" ? '; version: ' . PCRE_VERSION : '' ) . "\n"
1891
1916
. str_pad ("simplexml " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_simplexml; libxml version: " .LIBXML_DOTTED_VERSION ."\n"
1892
1917
. str_pad ("dom " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_dom \n"
1918
+ . str_pad ("ctype " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_ctype \n"
1893
1919
. str_pad ("intl " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_intl " . ($ has_intl == "{$ colorGreen }yes {$ colorReset }" ? '; icu version: ' . INTL_ICU_VERSION : '' )."\n"
1894
1920
. str_pad ("-optional-> " , $ padInfo , ' ' , STR_PAD_LEFT ) . "\n"
1895
1921
. str_pad ("gd " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_gd: version: " . GD_VERSION ."\n"
@@ -1904,6 +1930,7 @@ function print_results_common()
1904
1930
. str_pad ("memcache " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_memcache, version: " .MEMCACHE_VERSION ."; \n"
1905
1931
. str_pad ("redis " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_redis, version: " .REDIS_VERSION ."; \n"
1906
1932
. str_pad ("sqlite3 " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_sqlite3, version: " .SQLITE3_VERSION ."; \n"
1933
+ . str_pad ("sodium " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_sodium, version: " .SODIUM_LIBRARY_VERSION ."; \n"
1907
1934
. str_pad ("-alternative-> " , $ padInfo , ' ' , STR_PAD_LEFT ) . "\n"
1908
1935
. str_pad ("igbinary " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_igb \n"
1909
1936
. str_pad ("msgpack " , $ padInfo , ' ' , STR_PAD_LEFT ) . " : $ has_msg \n"
0 commit comments