Bug #77095 [NEW]: slowness regression in 7.2/7.3 (compared to 7.1)

From: Date: Fri, 02 Nov 2018 13:13:48 +0000
Subject: Bug #77095 [NEW]: slowness regression in 7.2/7.3 (compared to 7.1)
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217797@lists.php.net to get a copy of this message
From:             remi
Operating system: 
PHP version:      7.2.11
Package:          PCRE related
Bug Type:         Bug
Bug description:slowness regression in 7.2/7.3 (compared to 7.1)

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



-- 
Edit bug report at https://bugs.php.net/bug.php?id=77095&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=77095&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=77095&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=77095&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=77095&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=77095&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=77095&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=77095&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=77095&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=77095&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=77095&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=77095&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=77095&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=77095&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77095&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=77095&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=77095&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=77095&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77095&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=77095&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=77095&r=mysqlcfg



Thread (2 messages)

« previous php.bugs (#217797) next »