Hey;
   I think it's a great idea, if all op_arrays in one script share the same
literals table, let's say it's main scope 's literals table.

   then we can make all class entry, function entry share the same constant
literal..

   image that, same class(function) only need to lookup once in one
script.. rest will all hits cache.... I think we can gain significant
peformance improve there.


 thanks


On Wed, Apr 10, 2013 at 7: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?
>
> Thanks. Dmitry.
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
Laruence  Xinchen Hui
http://www.laruence.com/

Reply via email to