|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-11-02 13:14 UTC] ab@php.net
-Assigned To:
+Assigned To: ab
[2018-11-05 21:59 UTC] ab@php.net
-Status: Assigned
+Status: Closed
[2018-11-05 21:59 UTC] ab@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
Description: ------------ When pcre.jit=1 everything is ok With pcre.jit=0 we encounter slowness From valgrind / kcachegrind results, 99% spent in php_pcre_math_impl (in pcre_exec for 7.2 or php_pcre2_match for 7.3) Test script: --------------- <?php printf("PHP version %s\n", PHP_VERSION); printf("pcre.jit=%d\n", ini_get('pcre.jit')); $fd = __DIR__.'/data'; $a = str_repeat("\n", 1000000); file_put_contents($fd, $a); $fi = finfo_open(FILEINFO_NONE); $t = microtime(true); var_dump(finfo_file($fi, $fd)); printf("Time = %.4f\n", microtime(true) - $t); finfo_close($fi); Expected result: ---------------- PHP version 7.1.24RC1 pcre.jit=1 string(10) "ASCII text" Time = 0.0147 Actual result: -------------- PHP version 7.2.12RC1 pcre.jit=1 string(10) "ASCII text" Time = 0,0172 PHP version 7.2.12RC1 pcre.jit=0 string(10) "ASCII text" Time = 0,6555 40 times slower PHP version 7.3.0RC4 pcre.jit=1 string(10) "ASCII text" Time = 0.0177 PHP version 7.3.0RC4 pcre.jit=0 string(10) "ASCII text" Time = 2.2364 126 times slower