Re: OPcache compilation performance regression in PHP 5.6/7 with huge classes
| From: | David Zuelke | Date: | Wed, 15 Mar 2017 09:37:53 +0000 |
| Subject: | Re: OPcache compilation performance regression in PHP 5.6/7 with huge classes | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-98534@lists.php.net to get a copy of this message | ||
On 14 Mar 2017, at 16:39, Nikita Popov <nikita.ppv@gmail.com> wrote:
>
> On Tue, Mar 14, 2017 at 11:29 AM, David Zuelke <dz@heroku.com> wrote:
>> Hi all,
>>
>> There appears to be a performance regression in the CFG and DFA based optimization passes
>> of OPcache in PHP 5.6+ when loading huge classes (such as those generated by Symfony's routing
>> component) for the first time.
>>
>> ....
>>
>> Is this slowness with a cold cache expected/accepted, or does that qualify as a bug?
>
> Yes, this is a bug. Optimization should never be this slow.
>
> From a quick perf run, the problem in the DFA pass is that TI is quadratic in the number of
> calls (as call lookup is implemented as a linear scan). This can be fixed with a more efficient map
> lookup.
> The problem in the CFG pass is that a large buffer is zeroed repeatedly.
Alright, thanks! I opened a bug for it: https://bugs.php.net/bug.php?id=74250