Yes. And it's the reason I'm asking for agreement. I may commit it into master and pecl, but it means that pecl branch is going to be ahead of PHP-5.5.
Thanks. Dmitry. On Wed, Apr 10, 2013 at 5:24 PM, Pierre Joye <pierre....@gmail.com> wrote: > hi Dmitry, > > On Wed, Apr 10, 2013 at 1:57 PM, Dmitry Stogov <dmi...@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 >