Hey Lin:

On Fri, Oct 23, 2015 at 3:31 PM, Lin Yo-An <cornelius.h...@gmail.com> wrote:

> Hi Dmitry,
>
>
> I changed and tested it, and it looks like it gains some improvements. how
> do you compare the benchmark result? is there a tool doing it?
>
> I currently do:
>
> ./sapi/cli/php Zend/bench.php
>
> The result:
>
> https://gist.github.com/4bbc33b7b5dcedc6bd66
>
Acutally, simply bench.php testing is very un-stable. in generally, we
prefer using real-life app to test, like wordpress.

Basically, we use callgrind to collect the IRs ,  like valgrind
--tool=callgrind --instr-atstart=yes php-cgi -T 100 wordpress/index.php ( I
may type args wrong).

But in this case(cache friendly), you may try to use perf to collect cache
miss changing.

thanks

>
>
>
> On Fri, Oct 23, 2015 at 12:39 AM, Dmitry Stogov <dmi...@zend.com> wrote:
>
>>
>> On Oct 22, 2015 3:45 PM, "Lin Yo-An" <cornelius.h...@gmail.com> wrote:
>> >
>> > Hi all,
>> >
>> >
>> > I am looking into zend op_array structure, and few questions raised in
>> my mind:
>> >
>> > 1. Why op_array->refcount uses *uint32 instead of uint32, is there a
>> reason? if we can replace it with uint32, then we might save one emalloc
>> call for memory allocation for every op_array allocation?
>>
>> We may have few different op_array structures with the same opcodes but
>> with different names for example. So just uint32won't work.
>>
>> >
>> > 2. There are also a lot of information saved in the op_array structure,
>> if we can move line_start, line_end, doc_comments...etc into an external
>> structure, then we might be able to reduce the op_array size and decrease
>> the cache miss? is it doable?
>>
>> I'm not sure if patritioning data of op_array, into frequntly and rarely
>> used, may make any significant difference. Because we usually work only
>> with a single instance of op_array in each moment. Fields reordering alrecy
>> helped to reduce cache-misses. But I may be wrog :)
>>
>> Thanks. Dmitry.
>>
>> >
>> >
>> >
>> > Cheers,
>> > Yo-An Lin
>> > https://github.com/c9s
>> >
>>
>
>
>
> --
> Best Regards,
>
> Yo-An Lin
>



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

Reply via email to