@@ -129,6 +129,8 @@ function print_pre($msg) {
129
129
130
130
$ showOnlySystemInfo = 0 ;
131
131
132
+ $ doNotTaskSet = 0 ;
133
+
132
134
$ selectedTests = array ();
133
135
134
136
if ($ t = (int )getenv ('PHP_TIME_LIMIT ' )) {
@@ -173,6 +175,13 @@ function print_pre($msg) {
173
175
$ showOnlySystemInfo = 1 ;
174
176
}
175
177
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
+
176
185
if ($ r = getenv ('RUN_TESTS ' )) {
177
186
$ selectedTests = explode (', ' , $ r );
178
187
}
@@ -186,6 +195,7 @@ function print_pre($msg) {
186
195
$ shortopts .= "D " ;
187
196
$ shortopts .= "L " ;
188
197
$ shortopts .= "I " ;
198
+ $ shortopts .= "S " ;
189
199
$ shortopts .= "m: " ; // Обязательное значение
190
200
$ shortopts .= "t: " ; // Обязательное значение
191
201
$ shortopts .= "T: " ; // Обязательное значение
@@ -196,6 +206,7 @@ function print_pre($msg) {
196
206
"dumb-test-print " ,
197
207
"list-tests " ,
198
208
"system-info " ,
209
+ "do-not-task-set " ,
199
210
"memory-limit: " , // Обязательное значение
200
211
"time-limit: " , // Обязательное значение
201
212
"run-test: " , // Обязательное значение
@@ -224,13 +235,14 @@ function print_pre($msg) {
224
235
PHP_EOL
225
236
. 'PHP Benchmark Performance Script, version ' . $ scriptVersion . PHP_EOL
226
237
. 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
228
239
. PHP_EOL
229
240
. ' -h|--help - print this help and exit ' . PHP_EOL
230
241
. ' -d|--dont-recalc - do not recalculate test times / operations count even if memory of execution time limits are low ' . PHP_EOL
231
242
. ' -D|--dumb-test-print - print dumb test time, for debug purpose ' . PHP_EOL
232
243
. ' -L|--list-tests - output list of available tests and exit ' . PHP_EOL
233
244
. ' -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
234
246
. ' -m|--memory-limit <Mb> - set memory_limit value in Mb, defaults to 256 (Mb) ' . PHP_EOL
235
247
. ' -t|--time-limit <sec> - set max_execution_time value in seconds, defaults to 600 (sec) ' . PHP_EOL
236
248
. ' -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) {
243
255
PHP_EOL
244
256
. 'PHP Benchmark Performance Script, version ' . $ scriptVersion . PHP_EOL
245
257
. 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
247
259
. PHP_EOL
248
260
. ' -h - print this help and exit ' . PHP_EOL
249
261
. ' -d - do not recalculate test times / operations count even if memory of execution time limits are low ' . PHP_EOL
250
262
. ' -D - print dumb test time, for debug purpose ' . PHP_EOL
251
263
. ' -L - output list of available tests and exit ' . PHP_EOL
252
264
. ' -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
253
266
. ' -m <Mb> - set memory_limit value in Mb, defaults to 256 (Mb) ' . PHP_EOL
254
267
. ' -t <sec> - set max_execution_time value in seconds, defaults to 600 (sec) ' . PHP_EOL
255
268
. ' -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) {
290
303
$ showOnlySystemInfo = 1 ;
291
304
break ;
292
305
306
+ case 'S ' :
307
+ case 'do-not-task-set ' :
308
+ $ doNotTaskSet = 1 ;
309
+ break ;
310
+
293
311
case 't ' :
294
312
case 'time-limit ' :
295
313
if (is_numeric ($ oval )) {
@@ -321,7 +339,7 @@ function print_pre($msg) {
321
339
@ini_set ('memory_limit ' , $ defaultMemoryLimit . 'M ' );
322
340
323
341
if (php_sapi_name () == 'cli ' ) {
324
- if (file_exists ('/usr/bin/taskset ' )) {
342
+ if (file_exists ('/usr/bin/taskset ' ) && ! $ doNotTaskSet ) {
325
343
shell_exec ('/usr/bin/taskset -c -p 0 ' . getmypid ());
326
344
}
327
345
}
@@ -354,19 +372,19 @@ function print_pre($msg) {
354
372
$ loopMaxPhpTimesMHz = 3800 ;
355
373
// How much time needed for tests on this machine
356
374
$ 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 ,
370
388
);
371
389
// Simple and fast test times, used to adjust all test times and limits
372
390
$ dumbTestMaxPhpTimes = array (
0 commit comments