[PHP-DEV] Re: Object getter method optimization

2016-04-05 Thread Lin Yo-An
On Tue, Apr 5, 2016 at 10:14 PM, Dmitry Stogov wrote: > I think, op_array->type and op_array->fn_flags can't be reused. > > Also, usage of op_array->run_time_cache is safer (I remember, I saw some > SIGSEGV with your patch and opcache.protect_memory=1) > Got it.Does

[PHP-DEV] Re: Object getter method optimization

2016-04-05 Thread Lin Yo-An
I updated my PR here https://github.com/php/php-src/pull/1847/files#diff-3054389ad750ce9a9f5895cd6d27800fR3159 On Tue, Apr 5, 2016 at 10:02 PM, Lin Yo-An wrote: > sorry, one typo, the "op_array->type" should be "op_array->fn_flags" > -- Best Regards, Yo-An Lin

[PHP-DEV] Re: Object getter method optimization

2016-04-05 Thread Lin Yo-An
sorry, one typo, the "op_array->type" should be "op_array->fn_flags"

[PHP-DEV] Re: Object getter method optimization

2016-04-05 Thread Dmitry Stogov
I think, op_array->type and op_array->fn_flags can't be reused. Also, usage of op_array->run_time_cache is safer (I remember, I saw some SIGSEGV with your patch and opcache.protect_memory=1) Most probably, I'll able to return to this idea only at the end of the week or even on next week.

[PHP-DEV] Re: Object getter method optimization

2016-04-05 Thread Lin Yo-An
Hi Dmitry, Glad to hear your news, I just checked your patch and I like the approach you've done. :] I'm also still working on this idea this week, the const value accessor support was just added today. And I guess we may also support setters in the future (if possible) my thought is: - I

Re: [PHP-DEV] RETURN micro optimization

2016-04-05 Thread Joe Watkins
Dmitry, No worries ... I had just found out it wasn't particular to phpdbg ... Cheers Joe On Tue, Apr 5, 2016 at 1:14 PM, Dmitry Stogov wrote: > > > On 04/05/2016 12:04 PM, Derick Rethans wrote: > >> On Tue, 5 Apr 2016, Dmitry Stogov wrote: >> >> I propose a micro

Re: [PHP-DEV] RETURN micro optimization

2016-04-05 Thread Dmitry Stogov
On 04/05/2016 12:04 PM, Derick Rethans wrote: On Tue, 5 Apr 2016, Dmitry Stogov wrote: I propose a micro optimization for RETURN statement. Currently "return $x" increments reference counter of $x, then in zend_leave_helper() we perform zval_ptr_dtor() on the same $x. The patch sets the

Re: [PHP-DEV] Copy On Write and Assign By Reference perform different on PHP5 and PHP7

2016-04-05 Thread Rowan Collins
Sara Golemon wrote on 01/04/2016 02:52: On Thu, Mar 31, 2016 at 9:47 AM, Huqiu Liao wrote: I have a question about Assign By Reference and I posted on StackOverflow, I'd like to know the reason behind it, and I did not get any this kind of answer, can anyone give me some

Re: [PHP-DEV] RETURN micro optimization

2016-04-05 Thread Dmitry Stogov
But somehow it broke one phpdbg test, so it's better to check. Thanks. Dmitry. On 04/05/2016 12:15 PM, Joe Watkins wrote: Morning Derick, I don't think it does make anything impossible, it's just a more efficient copying method in the EXPECTED branch is all. Cheers Joe On Tue, Apr 5,

[PHP-DEV] BAD Benchmark Results for PHP Master 2016-04-05

2016-04-05 Thread lp_benchmark_robot
Results for project PHP master, build date 2016-04-05 06:34:55+03:00 commit: b68e89e previous commit:e7730fe revision date: 2016-04-05 00:07:28+02:00 environment:Haswell-EP cpu:Intel(R) Xeon(R) CPU E5-2699 v3 @ 2.30GHz 2x18 cores, stepping 2, LLC 45 MB

[PHP-DEV] Re: Object getter method optimization

2016-04-05 Thread Dmitry Stogov
Hi Yo-An Lin, I spent few hours working on your idea and came to the following path. https://gist.github.com/dstogov/2221ffc21ac16311c958a4830dbcee0f I tried to keep binary compatibility, minimize run-time checks overhead and fix related problems and leaks. BTW I'm not sure, if I like the

Re: [PHP-DEV] Final properties

2016-04-05 Thread Michał Brzuchalski
Hi, 2016-04-05 12:13 GMT+02:00 Marco Pivetta : > Hi, > > On 5 April 2016 at 12:06, Michał Brzuchalski > wrote: > >> Hi Marco, >> >> Ad. 1 it is posiible to redeclare in a sub-class final property as >> non-final, here is some gist presenting my

Re: [PHP-DEV] Final properties

2016-04-05 Thread Marco Pivetta
Hi, On 5 April 2016 at 12:06, Michał Brzuchalski wrote: > Hi Marco, > > Ad. 1 it is posiible to redeclare in a sub-class final property as > non-final, here is some gist presenting my current impl working like: >

Re: [PHP-DEV] Final properties

2016-04-05 Thread Michał Brzuchalski
Hi Marco, Ad. 1 it is posiible to redeclare in a sub-class final property as non-final, here is some gist presenting my current impl working like: https://gist.github.com/brzuchal/12ebda1efed59440a78ba43bff116728 Ad. 2. `final` means class variable (like static) or class instance property can

Re: [PHP-DEV] RETURN micro optimization

2016-04-05 Thread Joe Watkins
Morning Derick, I don't think it does make anything impossible, it's just a more efficient copying method in the EXPECTED branch is all. Cheers Joe On Tue, Apr 5, 2016 at 10:04 AM, Derick Rethans wrote: > On Tue, 5 Apr 2016, Dmitry Stogov wrote: > > > I propose a micro

Re: [PHP-DEV] Final properties

2016-04-05 Thread Marco Pivetta
Hi Michał, First of all: +1 to this: very useful for value objects! A few questions: * can you re-declare a final property in a sub-class, making it therefore non-final? (I have reasons to do that, related with altering states via mappers) * do we want to use `final`, or `immutable` for these

Re: [PHP-DEV] IntlCharsetDetector

2016-04-05 Thread Derick Rethans
On Mon, 4 Apr 2016, Sara Golemon wrote: > The subject of character set detection (yes, I know, a hard problem to > solve) came up on SO chat, and Niki noticed that we don't yet wrap the > ICU UCharsetDetector API so I volunteered to put something together. > >

Re: [PHP-DEV] RETURN micro optimization

2016-04-05 Thread Derick Rethans
On Tue, 5 Apr 2016, Dmitry Stogov wrote: > I propose a micro optimization for RETURN statement. > > Currently "return $x" increments reference counter of $x, then in > zend_leave_helper() we perform zval_ptr_dtor() on the same $x. > > The patch sets the original value of $x to null in first

Re: [PHP-DEV] RETURN micro optimization

2016-04-05 Thread Pierre Joye
On Tue, Apr 5, 2016 at 2:59 PM, Dmitry Stogov wrote: > Hi, > > > I propose a micro optimization for RETURN statement. > > Currently "return $x" increments reference counter of $x, then in > zend_leave_helper() we perform zval_ptr_dtor() on the same $x. > > The patch sets the

[PHP-DEV] RETURN micro optimization

2016-04-05 Thread Dmitry Stogov
Hi, I propose a micro optimization for RETURN statement. Currently "return $x" increments reference counter of $x, then in zend_leave_helper() we perform zval_ptr_dtor() on the same $x. The patch sets the original value of $x to null in first place, so zval_ptr_dtor() is not going to be