Re: Re: About optimization for compiler
| From: | Xinchen Hui | Date: | Fri, 27 Feb 2015 06:49:30 +0000 |
| Subject: | Re: Re: About optimization for compiler | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-83962@lists.php.net to get a copy of this message | ||
Hey:
On Fri, Feb 27, 2015 at 2:41 PM, reeze <reeze@php.net> wrote:
> Hi,
>
> On 27 February 2015 at 14:26, Xinchen Hui <laruence@gmail.com> wrote:
>>
>> Hey:
>>
>> On Fri, Feb 27, 2015 at 2:22 PM, Xinchen Hui <laruence@gmail.com> wrote:
>> > Hey Internals:
>> >
>> > I was looking Bob's switch optimization..
>> >
>> > then I start to worry about where is the place optimization should
>> > goes..
>> >
>> > in generally, PHP is a interpreted language. IMO, it should
>> > compiler the PHP codes to opcode without any optimization(of course,
>> > we did some, but they won't change a lots of opcodes which should be
>> > generated)..
>> >
>> > and, since 5.5, we already have opcache bundled in..
>> >
>> > thus, I am proposing a principle, that is:
>> >
>> > in the future, we only do optimization in opcache side, and keep
>> or maybe big optimization? but I don't know how to define "big" or
>> "small" optimizations now..
>>
>> (small is the optimizations, we are sure it is safe, maybe)
>>
>> thanks
>> > Zend Compiler without any optimization... considering Zend Compiler do
>> > things in -O0.
>> >
>> > since, optimization always are dangerous.. if we only do them in
>> > opcache, user can still run them codes with disable opcache, or at
>> > least disable some optimization level which cause that..
>> >
>> > what do you think?
>
>
> We may need to clarify which kind of optimizations we want to set a
> principle.
> There are different level's optimizations.
>
> Opcache is a opcode to opcode optimizer, but some optimizations might need
> lower level
> optimizations like Bob's, some might need to change base data structure.
>
> We have AST intermediate represent structure, there might be some AST level
> optimizations, this not opcache's job too.
maybe you misunderstand , but let me declare it again.
that's what I proposed.. keep opcodes honestly represents what php
codes is... (stop doing optimization for compiler for now, and
introduces APIs for optimizations, then do them outside of Zend)
thanks
>
>>
>> >
>> > thanks
>> >
>> > --
>> > Xinchen Hui
>> > @Laruence
>> > http://www.laruence.com/
>>
>>
>>
>> --
>> Xinchen Hui
>> @Laruence
>> http://www.laruence.com/
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
>
> --
> Reeze Xia
> http://reeze.cn
--
Xinchen Hui
@Laruence
http://www.laruence.com/