Re: OPcache optimizer improvement in PHP-5.5?
| From: | Pierre Joye | Date: | Wed, 10 Apr 2013 13:24:27 +0000 |
| Subject: | Re: OPcache optimizer improvement in PHP-5.5? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-67029@lists.php.net to get a copy of this message | ||
hi Dmitry,
On Wed, Apr 10, 2013 at 1:57 PM, Dmitry Stogov <dmitry@zend.com> wrote:
> Hi,
>
> Recently, I've found that OPcache optimizer misses a lot of abilities,
> because it handles only one op_array at once. So it definitely can't perform
> any inter-function optimizations (e.g. inlining).
>
> Actually, it was not very difficult to switch to "script at once" approach.
> The attached patch demonstrates it and adds per script constants
> substitution explained in the following script
>
> <?php
> define("FOO", 1);
> function foo() {
> echo FOO . "\n"; // optimizer will replace it with: echo "1\n";
> }
> ?>
>
> Of course, I ran the PHP test suite and it passed all the same tests.
> Personally, I think it's safe to include this patch into 5.5 and make a
> green light to some other advanced optimizations in 5.5. (e.g. conversion
> INIT_FCALL_BY_NAME into DO_FCALL).
>
> Any thoughts?
Mixed feeling, I like this "simple" optimization and the possible
gains but 5.5 is very closed from RC.
Cheers,
--
Pierre
@pierrejoye