Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2b5bf9d

Browse files
Версия 1.0.47 - больше xdebug
1 parent e33b3cd commit 2b5bf9d

File tree

6 files changed

+63
-20
lines changed

6 files changed

+63
-20
lines changed

‎.htaccess‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ php_flag apc.enable 0
88
# still - xdebug slow things
99
php_flag xdebug.default_enable 0
1010
php_flag xdebug.show_exception_trace 0
11+
php_flag xdebug.remote_autostart 0
12+
php_flag xdebug.remote_enable 0
13+
php_value xdebug.mode off
1114

1215
php_value output_bufering 0
1316
php_value max_execution_time 600

‎.user.ini‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ apc.enable_cli = 0
1313
; still - xdebug slow things
1414
xdebug.default_enable = 0
1515
xdebug.show_exception_trace = 0
16+
xdebug.remote_autostart = 0
17+
xdebug.remote_enable = 0
18+
xdebug.mode = off
1619

1720
output_bufering = 0
1821
max_execution_time = 600

‎CHANGELOG.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# ChangeLog
22

3+
@ 2022年05月03日, v1.0.47
4+
5+
* Улучшен вывод предупреждения про xdebug
6+
* Если включен xdebug - не падаем, а пробуем провести тесты с ним
7+
* Добавлены еще параметры для xdebug в .htaccess и .user.ini
8+
39
@ 2022年05月02日, v1.0.46
410

511
* Добавлен простой тест - генерация phpinfo.

‎README.en.md‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Works with all versions of PHP: from 4.3 to 8.1
44

55
## Dependencies
66

7-
Required modules for php:
7+
Required modules for full php testing:
88

99
- pcre
1010
- mbstring
@@ -20,6 +20,12 @@ How to check it:
2020
- in console: `php -m`
2121
- or via function `phpinfo()` output
2222

23+
### Modules affecting test results
24+
25+
- xdebug - can slow down most of the tests by half, and some related to error handling - by 10!
26+
- opcache - can cache the execution of functions, or throw out "not affecting execution" pieces of code
27+
- other opcode accelerators: xcache, apc, eaccelerator, etc.
28+
2329
## Startup
2430

2531
### 0. Files
@@ -102,20 +108,26 @@ This applies to all ARM, MIPS, etc. As well as old AMD and Intel processors like
102108
## Example script output
103109

104110
```
111+
<<< WARNING >>> You need to disable Xdebug extension! It greatly slow things down! And mess with PHP internals.
112+
<<< WARNING >>> Execution time limit not droppped to '600' seconds!
113+
Script will have only '0' seconds to run.
114+
<<< WARNING >>> Extension 'xdebug' loaded! It will affect results and slow things greatly! Even if not enabled!
115+
<<< WARNING >>> Set xdebug.mode in php.ini / VHost or FPM config / php_admin_value or via cmd '-dxdebug.mode=off' option of PHP executable.
116+
105117
-------------------------------------------------------------------------------------------
106118
| PHP BENCHMARK SCRIPT |
107119
-------------------------------------------------------------------------------------------
108-
Start : 2022-05-02 19:54:25
120+
Start : 2022-05-03 18:22:49
109121
Server : Linux/5.4.0-104-lowlatency x86_64
110122
Platform : Linux
111123
System : Ubuntu 18.04.6 LTS
112124
CPU :
113125
model : Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
114126
cores : 4
115127
available : 4
116-
MHz : 3788.844 MHz
117-
Benchmark version : 1.0.46
118-
PHP version : 8.1.2-SergeyD/1.4
128+
MHz : 3600 MHz
129+
Benchmark version : 1.0.47
130+
PHP version : 7.4.29-SergeyD/6.1
119131
PHP time limit : 0 sec
120132
Setup time limit : 600 sec
121133
PHP memory limit : 128M
@@ -134,7 +146,7 @@ Crypt hash algo : MD5
134146
xcache : no; enabled: 0
135147
apc : no; enabled: 0
136148
eaccelerator : no; enabled: 0
137-
xdebug : no
149+
xdebug : yes, enabled: 1, mode: 'develop'
138150
PHP parameters
139151
open_basedir : is empty? yes
140152
mb.func_overload : 0

‎README.md‎

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Зависимости
66

7-
Необходимы модули для php:
7+
Необходимые модули для полного тестирования php:
88

99
- pcre
1010
- mbstring
@@ -20,6 +20,12 @@
2020
- в консоли `php -m`
2121
- или через вывод функции `phpinfo()`
2222

23+
### Модули, влияющие на результаты тестов
24+
25+
- xdebug - может замедлить работу большей части тестов в два раза, а некоторых, связанных с обработкой ошибок - в 10!
26+
- opcache - может закешировать выполнение функций, или выкинуть "не влияющие на выполнение" куски кода
27+
- другие ускорители оп-кода: xcache, apc, eaccelerator и т.п.
28+
2329
## Запуск
2430

2531
### 0. Файлы
@@ -103,20 +109,26 @@ env PHP_MEMORY_LIMIT=64 PHP_TIME_LIMIT=30 php bench.php
103109
## Пример вывода скрипта
104110

105111
```
112+
<<< WARNING >>> You need to disable Xdebug extension! It greatly slow things down! And mess with PHP internals.
113+
<<< WARNING >>> Execution time limit not droppped to '600' seconds!
114+
Script will have only '0' seconds to run.
115+
<<< WARNING >>> Extension 'xdebug' loaded! It will affect results and slow things greatly! Even if not enabled!
116+
<<< WARNING >>> Set xdebug.mode in php.ini / VHost or FPM config / php_admin_value or via cmd '-dxdebug.mode=off' option of PHP executable.
117+
106118
-------------------------------------------------------------------------------------------
107119
| PHP BENCHMARK SCRIPT |
108120
-------------------------------------------------------------------------------------------
109-
Start : 2022-05-02 19:54:25
121+
Start : 2022-05-03 18:22:49
110122
Server : Linux/5.4.0-104-lowlatency x86_64
111123
Platform : Linux
112124
System : Ubuntu 18.04.6 LTS
113125
CPU :
114126
model : Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz
115127
cores : 4
116128
available : 4
117-
MHz : 3788.844 MHz
118-
Benchmark version : 1.0.46
119-
PHP version : 8.1.2-SergeyD/1.4
129+
MHz : 3600 MHz
130+
Benchmark version : 1.0.47
131+
PHP version : 7.4.29-SergeyD/6.1
120132
PHP time limit : 0 sec
121133
Setup time limit : 600 sec
122134
PHP memory limit : 128M
@@ -135,7 +147,7 @@ Crypt hash algo : MD5
135147
xcache : no; enabled: 0
136148
apc : no; enabled: 0
137149
eaccelerator : no; enabled: 0
138-
xdebug : no
150+
xdebug : yes, enabled: 1, mode: 'develop'
139151
PHP parameters
140152
open_basedir : is empty? yes
141153
mb.func_overload : 0

‎bench.php‎

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
# Company : Code24 BV, The Netherlands #
1010
# Author : Sergey Dryabzhinsky #
1111
# Company : Rusoft Ltd, Russia #
12-
# Date : May 02, 2022 #
13-
# Version : 1.0.46 #
12+
# Date : May 03, 2022 #
13+
# Version : 1.0.47 #
1414
# License : Creative Commons CC-BY license #
1515
# Website : https://github.com/rusoft/php-simple-benchmark-script #
1616
# Website : https://git.rusoft.ru/open-source/php-simple-benchmark-script #
@@ -32,7 +32,7 @@ function print_pre($msg) {
3232
flush();
3333
}
3434

35-
$scriptVersion = '1.0.46';
35+
$scriptVersion = '1.0.47';
3636

3737
// Special string to flush buffers, nginx for example
3838
$flushStr = '<!-- '.str_repeat("", 8192).' -->';
@@ -61,8 +61,7 @@ function print_pre($msg) {
6161
// Check XDebug
6262
$xdebug = (int)ini_get('xdebug.default_enable');
6363
if ($xdebug) {
64-
print_pre('<<< ERROR >>> You need to disable Xdebug extension! It greatly slow things down!'.PHP_EOL);
65-
exit(1);
64+
print_pre('<<< WARNING >>> You need to disable Xdebug extension! It greatly slow things down! And mess with PHP internals.'.PHP_EOL);
6665
}
6766

6867
// Check OpCache
@@ -367,7 +366,7 @@ function print_pre($msg) {
367366

368367
$set = set_time_limit($defaultTimeLimit);
369368
if ($set === false) {
370-
print_pre("<<< WARNING >>> Execution time limit not droppped to '{$defaultTimeLimit}' seconds!\nScript will have only '{$originTimeLimit}' seconds to" . PHP_EOL);
369+
print_pre("<<< WARNING >>> Execution time limit not droppped to '{$defaultTimeLimit}' seconds!\nScript will have only '{$originTimeLimit}' seconds to run." . PHP_EOL);
371370
}
372371
$set = ini_set('memory_limit', $defaultMemoryLimit . 'M');
373372
if ($set === false) {
@@ -1218,9 +1217,17 @@ function format_result_test($diffSeconds, $opCount, $memory = 0)
12181217
}
12191218
$has_xdebug = "no";
12201219
if (extension_loaded('xdebug')) {
1221-
print_pre("<<< WARNING >>> Extension 'xdebug' loaded! It will affect results and slow things greatly! Even if not enabled!");
1220+
print_pre("<<< WARNING >>> Extension 'xdebug' loaded! It will affect results and slow things greatly! Even if not enabled!\n");
1221+
print_pre("<<< WARNING >>> Set xdebug.mode in php.ini / VHost or FPM config / php_admin_value or via cmd '-dxdebug.mode=off' option of PHP executable.\n");
12221222
$has_xdebug = "yes";
1223+
ini_set("xdebug.mode", "off");
1224+
ini_set("xdebug.default_enable", 0);
1225+
ini_set("xdebug.remote_autostart", 0);
1226+
ini_set("xdebug.remote_enable", 0);
1227+
ini_set("xdebug.profiler_enable", 0);
12231228
}
1229+
$xdbg_mode = ini_get("xdebug.mode");
1230+
12241231
$has_dom = "no";
12251232
if (extension_loaded('dom')) {
12261233
$has_dom = "yes";
@@ -1273,7 +1280,7 @@ function format_result_test($diffSeconds, $opCount, $memory = 0)
12731280
. str_pad("xcache", $padInfo, '', STR_PAD_LEFT) . " : $has_xcache; enabled: {$xcache}\n"
12741281
. str_pad("apc", $padInfo, '', STR_PAD_LEFT) . " : $has_apc; enabled: {$apcache}\n"
12751282
. str_pad("eaccelerator", $padInfo, '', STR_PAD_LEFT) . " : $has_eacc; enabled: {$eaccel}\n"
1276-
. str_pad("xdebug", $padInfo, '', STR_PAD_LEFT) . " : $has_xdebug\n"
1283+
. str_pad("xdebug", $padInfo, '', STR_PAD_LEFT) . " : $has_xdebug, enabled: {$xdebug}, mode: '{$xdbg_mode}'\n"
12771284
. str_pad("PHP parameters", $padInfo, '', STR_PAD_LEFT) . "\n"
12781285
. str_pad("open_basedir", $padInfo, '', STR_PAD_LEFT) . " : is empty? ".(!$obd_set ? 'yes' : 'no')."\n"
12791286
. str_pad("mb.func_overload", $padInfo, '', STR_PAD_LEFT) . " : {$mbover}\n"

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /