Skip to content

Commit 59d46c2

Browse files
issue #3 - update test-php-version times, update changelog
1 parent 1dffb31 commit 59d46c2

File tree

2 files changed

+43
-16
lines changed

2 files changed

+43
-16
lines changed

CHANGELOG.md

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

3+
@ 2021-12-06, v1.0.44
4+
5+
* Тестирование классов DateTime, работает начиная с php-5.3
6+
* Тестирование классов модуля intl,
7+
- intlCalendar работает начиная с php-5.5,
8+
- остальные классы - с php-5.3, или php-5.2 + модуль из pecl
9+
* Обновлены кол-ва итераций в тестах и времена выполнения
10+
* Добавлена опция для отключения использования taskset для привязки к одному ядру процессора
11+
312
@ 2021-11-26, v1.0.43
413

514
* Добавлена поддержка php-8.1

bench.php

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ function print_pre($msg) {
129129

130130
$showOnlySystemInfo = 0;
131131

132+
$doNotTaskSet = 0;
133+
132134
$selectedTests = array();
133135

134136
if ($t = (int)getenv('PHP_TIME_LIMIT')) {
@@ -173,6 +175,13 @@ function print_pre($msg) {
173175
$showOnlySystemInfo = 1;
174176
}
175177

178+
if ((int)getenv('DO_NOT_TASK_SET')) {
179+
$doNotTaskSet = 1;
180+
}
181+
if (isset($_GET['do_not_task_set']) && (int)$_GET['do_not_task_set']) {
182+
$doNotTaskSet = 1;
183+
}
184+
176185
if ($r = getenv('RUN_TESTS')) {
177186
$selectedTests = explode(',', $r);
178187
}
@@ -186,6 +195,7 @@ function print_pre($msg) {
186195
$shortopts .= "D";
187196
$shortopts .= "L";
188197
$shortopts .= "I";
198+
$shortopts .= "S";
189199
$shortopts .= "m:"; // Обязательное значение
190200
$shortopts .= "t:"; // Обязательное значение
191201
$shortopts .= "T:"; // Обязательное значение
@@ -196,6 +206,7 @@ function print_pre($msg) {
196206
"dumb-test-print",
197207
"list-tests",
198208
"system-info",
209+
"do-not-task-set",
199210
"memory-limit:", // Обязательное значение
200211
"time-limit:", // Обязательное значение
201212
"run-test:", // Обязательное значение
@@ -224,13 +235,14 @@ function print_pre($msg) {
224235
PHP_EOL
225236
. 'PHP Benchmark Performance Script, version ' . $scriptVersion . PHP_EOL
226237
. PHP_EOL
227-
. 'Usage: ' . basename(__FILE__) . ' [-h|--help] [-d|--dont-recalc] [-D|--dumb-test-print] [-L|--list-tests] [-I|--system-info] [-m|--memory-limit=256] [-t|--time-limit=600] [-T|--run-test=name1 ...]' . PHP_EOL
238+
. 'Usage: ' . basename(__FILE__) . ' [-h|--help] [-d|--dont-recalc] [-D|--dumb-test-print] [-L|--list-tests] [-I|--system-info] [-S|--do-not-task-set] [-m|--memory-limit=256] [-t|--time-limit=600] [-T|--run-test=name1 ...]' . PHP_EOL
228239
. PHP_EOL
229240
. ' -h|--help - print this help and exit' . PHP_EOL
230241
. ' -d|--dont-recalc - do not recalculate test times / operations count even if memory of execution time limits are low' . PHP_EOL
231242
. ' -D|--dumb-test-print - print dumb test time, for debug purpose' . PHP_EOL
232243
. ' -L|--list-tests - output list of available tests and exit' . PHP_EOL
233244
. ' -I|--system-info - output system info but do not run tests and exit' . PHP_EOL
245+
. ' -S|--do-not-task-set - if run on cli - dont call taskset to ping process to one cpu core' . PHP_EOL
234246
. ' -m|--memory-limit <Mb> - set memory_limit value in Mb, defaults to 256 (Mb)' . PHP_EOL
235247
. ' -t|--time-limit <sec> - set max_execution_time value in seconds, defaults to 600 (sec)' . PHP_EOL
236248
. ' -T|--run-test <name> - run selected test, test names from --list-tests output, can be defined multiple times' . PHP_EOL
@@ -243,13 +255,14 @@ function print_pre($msg) {
243255
PHP_EOL
244256
. 'PHP Benchmark Performance Script, version ' . $scriptVersion . PHP_EOL
245257
. PHP_EOL
246-
. 'Usage: ' . basename(__FILE__) . ' [-h] [-d] [-D] [-L] [-m 256] [-t 600] [-T name1 ...]' . PHP_EOL
258+
. 'Usage: ' . basename(__FILE__) . ' [-h] [-d] [-D] [-L] [-I] [-S] [-m 256] [-t 600] [-T name1 ...]' . PHP_EOL
247259
. PHP_EOL
248260
. ' -h - print this help and exit' . PHP_EOL
249261
. ' -d - do not recalculate test times / operations count even if memory of execution time limits are low' . PHP_EOL
250262
. ' -D - print dumb test time, for debug purpose' . PHP_EOL
251263
. ' -L - output list of available tests and exit' . PHP_EOL
252264
. ' -I - output system info but do not run tests and exit' . PHP_EOL
265+
. ' -S - if run on cli - dont call taskset to ping process to one cpu core' . PHP_EOL
253266
. ' -m <Mb> - set memory_limit value in Mb, defaults to 256 (Mb)' . PHP_EOL
254267
. ' -t <sec> - set max_execution_time value in seconds, defaults to 600 (sec)' . PHP_EOL
255268
. ' -T <name> - run selected test, test names from -L output, can be defined multiple times' . PHP_EOL
@@ -290,6 +303,11 @@ function print_pre($msg) {
290303
$showOnlySystemInfo = 1;
291304
break;
292305

306+
case 'S':
307+
case 'do-not-task-set':
308+
$doNotTaskSet = 1;
309+
break;
310+
293311
case 't':
294312
case 'time-limit':
295313
if (is_numeric($oval)) {
@@ -321,7 +339,7 @@ function print_pre($msg) {
321339
@ini_set('memory_limit', $defaultMemoryLimit . 'M');
322340

323341
if (php_sapi_name() == 'cli') {
324-
if (file_exists('/usr/bin/taskset')) {
342+
if (file_exists('/usr/bin/taskset') && !$doNotTaskSet) {
325343
shell_exec('/usr/bin/taskset -c -p 0 ' . getmypid());
326344
}
327345
}
@@ -354,19 +372,19 @@ function print_pre($msg) {
354372
$loopMaxPhpTimesMHz = 3800;
355373
// How much time needed for tests on this machine
356374
$loopMaxPhpTimes = array(
357-
'4.4' => 322,
358-
'5.2' => 243,
359-
'5.3' => 207,
360-
'5.4' => 181,
361-
'5.5' => 177,
362-
'5.6' => 174,
363-
'7.0' => 97,
364-
'7.1' => 96,
365-
'7.2' => 92,
366-
'7.3' => 83,
367-
'7.4' => 79,
368-
'8.0' => 75,
369-
'8.1' => 74,
375+
'4.4' => 324,
376+
'5.2' => 248,
377+
'5.3' => 204,
378+
'5.4' => 188,
379+
'5.5' => 189,
380+
'5.6' => 186,
381+
'7.0' => 105,
382+
'7.1' => 102,
383+
'7.2' => 98,
384+
'7.3' => 89,
385+
'7.4' => 86,
386+
'8.0' => 81,
387+
'8.1' => 80,
370388
);
371389
// Simple and fast test times, used to adjust all test times and limits
372390
$dumbTestMaxPhpTimes = array(

0 commit comments

Comments
 (0)