Bug #77095 [Asn->Csd]: slowness regression in 7.2/7.3 (compared to 7.1)

From: Date: Mon, 05 Nov 2018 21:59:31 +0000
Subject: Bug #77095 [Asn->Csd]: slowness regression in 7.2/7.3 (compared to 7.1)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217835@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77095&edit=1

 ID:                 77095
 Updated by:         ab@php.net
 Reported by:        remi@php.net
 Summary:            slowness regression in 7.2/7.3 (compared to 7.1)
-Status:             Assigned
+Status:             Closed
 Type:               Bug
 Package:            PCRE related
 PHP Version:        7.2.11
 Assigned To:        ab
 Block user comment: N
 Private report:     N

 New Comment:

A fix was put to libmagic.

http://git.php.net/?p=php-src.git;a=commit;h=c621182c42a36975970586cfc294bc5a80ba08cb
http://git.php.net/?p=php-src.git;a=commit;h=7f5f46013b8a37bab6b378903aace5da9ce8dc5e

Further diff in libmagic versions might tell some difference. It seems to give an acceptable
performance with the given reproduce case, though. Thus, this should be ok to close for now.

Thanks.


Previous Comments:
------------------------------------------------------------------------
[2018-11-02 13:13:48] remi@php.net

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 this bug report at https://bugs.php.net/bug.php?id=77095&edit=1


Thread (2 messages)

« previous php.bugs (#217835) next »