Hi,
I'm working on call/return sequence optimization. As part of this work I'm
minimizing the size of call frame (zend_execute_data) and number of
read/write operations on call/return.
Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587e
All phpt tests are passed, but I'm not completely sure about one line -
https://gist.github.com/dstogov/5ad50d582346385d587e#file-ex_scope-05-diff-L193
On the other hand I can't imagine what it may break.
Matteo, can you please run your test suites with this patch.
PS: I'm also going to:
- pack EX(num_args) into reserved space of EX(This)
- try to get rid of EX(frame_info)
- try to merge EX(called_scope) and EX(This). Only one of them matters.
- try to replace zval EX(This) with a pointer to zend_object EX(object)
Thanks. Dmitry.
Hi Dmitry,
Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587eAll phpt tests are passed, but I'm not completely sure about one line -
https://gist.github.com/dstogov/5ad50d582346385d587e#file-ex_scope-05-diff-L193On the other hand I can't imagine what it may break.
Matteo, can you please run your test suites with this patch.
Done. No regressions found for:
- run-tests
- Revive Adserver + MySQL & Postgres
- PHPUnit
- phpspec
- Doctrine2 + SQLite & Postgres
Cheers
Matteo Beccati
Development & Consulting - http://www.beccati.com/
Thanks. Probably, I'll commit it tomorrow.
Dmitry.
Hi Dmitry,
Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587eAll phpt tests are passed, but I'm not completely sure about one line -
https://gist.github.com/dstogov/5ad50d582346385d587e#
file-ex_scope-05-diff-L193On the other hand I can't imagine what it may break.
Matteo, can you please run your test suites with this patch.
Done. No regressions found for:
- run-tests
- Revive Adserver + MySQL & Postgres
- PHPUnit
- phpspec
- Doctrine2 + SQLite & Postgres
Cheers
Matteo Beccati
Development & Consulting - http://www.beccati.com/
- try to merge EX(called_scope) and EX(This). Only one of them matters.
We could use the void *ptr in a zval (or add it to the available types
in the union) and add another flag for zval type. Anyone have an
objection with that?
- try to merge EX(called_scope) and EX(This). Only one of them matters.
We could use the void *ptr in a zval (or add it to the available types
in the union) and add another flag for zval type. Anyone have an
objection with that?
I just noticed we already support putting zend_class_entry* in zvals;
I'm not exactly sure what the internal representation of This is off
the top of my head, though; would they be compatible?
Yes, we may store EX(called_scope) in EX(This).value.ce and set another
type and/or flag(s).
But it shouldn't slowdown $this access in _get_obj_zval_ptr_unused() and
other often used functions.
If it's possible, we may try to merge, if not, it doesn't make sense.
Thanks. Dmitry.
- try to merge EX(called_scope) and EX(This). Only one of them matters.
We could use the void *ptr in a zval (or add it to the available types
in the union) and add another flag for zval type. Anyone have an
objection with that?I just noticed we already support putting zend_class_entry* in zvals;
I'm not exactly sure what the internal representation of This is off
the top of my head, though; would they be compatible?
Hey:
Hi,
I'm working on call/return sequence optimization. As part of this work I'm
minimizing the size of call frame (zend_execute_data) and number of
read/write operations on call/return.Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587eAll phpt tests are passed, but I'm not completely sure about one line -
https://gist.github.com/dstogov/5ad50d582346385d587e#file-ex_scope-05-diff-L193On the other hand I can't imagine what it may break.
neither do I.
Matteo, can you please run your test suites with this patch.
PS: I'm also going to:
- pack EX(num_args) into reserved space of EX(This)
- try to get rid of EX(frame_info)
- try to merge EX(called_scope) and EX(This). Only one of them matters.
- try to replace zval EX(This) with a pointer to zend_object EX(object)
Hmm, EX(This) is not like EX(object), it will be accessed by vm
handler: get_obj_zval_ptr_unused
it suppores to return a zval * there. if EX(This) became a zend_object
*, then we may face different handlers for IS_UNUSED and other types
:<
thanks
Thanks. Dmitry.
--
Xinchen Hui
@Laruence
http://www.laruence.com/
Hey:
Hi,
I'm working on call/return sequence optimization. As part of this work
I'm
minimizing the size of call frame (zend_execute_data) and number of
read/write operations on call/return.Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587e
committed.
All phpt tests are passed, but I'm not completely sure about one line -
https://gist.github.com/dstogov/5ad50d582346385d587e#file-ex_scope-05-diff-L193
On the other hand I can't imagine what it may break.
neither do I.Matteo, can you please run your test suites with this patch.
PS: I'm also going to:
- pack EX(num_args) into reserved space of EX(This)
done.
- try to get rid of EX(frame_info)
done.
- try to merge EX(called_scope) and EX(This). Only one of them matters.
- try to replace zval EX(This) with a pointer to zend_object EX(object)
Hmm, EX(This) is not like EX(object), it will be accessed by vm
handler: get_obj_zval_ptr_unusedit suppores to return a zval * there. if EX(This) became a zend_object
*, then we may face different handlers for IS_UNUSED and other types
:<
Yes, I know. After the latest changes it doesn't make a lot of sense to
replace ZVAL with ZEND_OBJECT*, because other data is already packed into
the same ZVAL and it won't save any memory.
Also zend_execute_data structure is aligned on zval boundary (16 bytes), so
it makes sense to save another 16 bytes, but saving 8 bytes won't affect VM
stack memory consumption.
Thanks. Dmitry.
thanks
Thanks. Dmitry.
--
Xinchen Hui
@Laruence
http://www.laruence.com/
2014.11.28. 9:24 ezt írta ("Dmitry Stogov" dmitry@zend.com):
Hey:
Hi,
I'm working on call/return sequence optimization. As part of this work
I'm
minimizing the size of call frame (zend_execute_data) and number of
read/write operations on call/return.Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587ecommitted.
All phpt tests are passed, but I'm not completely sure about one line -
https://gist.github.com/dstogov/5ad50d582346385d587e#file-ex_scope-05-diff-L193
On the other hand I can't imagine what it may break.
neither do I.Matteo, can you please run your test suites with this patch.
PS: I'm also going to:
- pack EX(num_args) into reserved space of EX(This)
done.
- try to get rid of EX(frame_info)
done.
- try to merge EX(called_scope) and EX(This). Only one of them
matters.- try to replace zval EX(This) with a pointer to zend_object
EX(object)Hmm, EX(This) is not like EX(object), it will be accessed by vm
handler: get_obj_zval_ptr_unusedit suppores to return a zval * there. if EX(This) became a zend_object
*, then we may face different handlers for IS_UNUSED and other types
:<Yes, I know. After the latest changes it doesn't make a lot of sense to
replace ZVAL with ZEND_OBJECT*, because other data is already packed into
the same ZVAL and it won't save any memory.Also zend_execute_data structure is aligned on zval boundary (16 bytes),
so
it makes sense to save another 16 bytes, but saving 8 bytes won't affect
VM
stack memory consumption.Thanks. Dmitry.
Fyi this change broke phpdbg in master.
Sorry, I'll try to fix it on Monday.
is it a compilation problem, or how can reproduce it?
Thanks. Dmitry.
2014.11.28. 9:24 ezt írta ("Dmitry Stogov" dmitry@zend.com):
Hey:
On Fri, Nov 28, 2014 at 1:27 AM, Dmitry Stogov dmitry@zend.com
wrote:Hi,
I'm working on call/return sequence optimization. As part of this
work
I'm
minimizing the size of call frame (zend_execute_data) and number of
read/write operations on call/return.Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587ecommitted.
All phpt tests are passed, but I'm not completely sure about one line -
https://gist.github.com/dstogov/5ad50d582346385d587e#file-ex_scope-05-diff-L193
On the other hand I can't imagine what it may break.
neither do I.Matteo, can you please run your test suites with this patch.
PS: I'm also going to:
- pack EX(num_args) into reserved space of EX(This)
done.
- try to get rid of EX(frame_info)
done.
- try to merge EX(called_scope) and EX(This). Only one of them
matters.- try to replace zval EX(This) with a pointer to zend_object
EX(object)Hmm, EX(This) is not like EX(object), it will be accessed by vm
handler: get_obj_zval_ptr_unusedit suppores to return a zval * there. if EX(This) became a zend_object
*, then we may face different handlers for IS_UNUSED and other types
:<Yes, I know. After the latest changes it doesn't make a lot of sense to
replace ZVAL with ZEND_OBJECT*, because other data is already packed into
the same ZVAL and it won't save any memory.Also zend_execute_data structure is aligned on zval boundary (16 bytes),
so
it makes sense to save another 16 bytes, but saving 8 bytes won't affect
VM
stack memory consumption.Thanks. Dmitry.
Fyi this change broke phpdbg in master.
2014.11.30. 11:14 ezt írta ("Dmitry Stogov" dmitry@zend.com):
Sorry, I'll try to fix it on Monday.
is it a compilation problem, or how can reproduce it?
I've fixed it already. There were two references to scope in phpdbg, you
probably missed it because phpdbg tests are not part of make test (but
could be).
Thanks. Dmitry.
2014.11.28. 9:24 ezt írta ("Dmitry Stogov" dmitry@zend.com):
On Fri, Nov 28, 2014 at 7:33 AM, Xinchen Hui xinchen.h@zend.com
wrote:Hey:
On Fri, Nov 28, 2014 at 1:27 AM, Dmitry Stogov dmitry@zend.com
wrote:Hi,
I'm working on call/return sequence optimization. As part of this
work
I'm
minimizing the size of call frame (zend_execute_data) and number of
read/write operations on call/return.Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587ecommitted.
All phpt tests are passed, but I'm not completely sure about one
line -
https://gist.github.com/dstogov/5ad50d582346385d587e#file-ex_scope-05-diff-L193
On the other hand I can't imagine what it may break.
neither do I.Matteo, can you please run your test suites with this patch.
PS: I'm also going to:
- pack EX(num_args) into reserved space of EX(This)
done.
- try to get rid of EX(frame_info)
done.
- try to merge EX(called_scope) and EX(This). Only one of them
matters.- try to replace zval EX(This) with a pointer to zend_object
EX(object)Hmm, EX(This) is not like EX(object), it will be accessed by vm
handler: get_obj_zval_ptr_unusedit suppores to return a zval * there. if EX(This) became a
zend_object
*, then we may face different handlers for IS_UNUSED and other types
:<Yes, I know. After the latest changes it doesn't make a lot of sense to
replace ZVAL with ZEND_OBJECT*, because other data is already packed
into
the same ZVAL and it won't save any memory.Also zend_execute_data structure is aligned on zval boundary (16
bytes), so
it makes sense to save another 16 bytes, but saving 8 bytes won't
affect VM
stack memory consumption.Thanks. Dmitry.
Fyi this change broke phpdbg in master.
thanks.
phpdbg was excluded in my DEBUG build (I was sure I built it, may be it was
enabled it default previously...)
Anyway, I enabled it now, and won't miss at least build problems.
According to "make test", it would be great to make it run all the tests.
For some reason "ext/opcahce" tests are excluded as well.
Thanks. Dmitry.
2014.11.30. 11:14 ezt írta ("Dmitry Stogov" dmitry@zend.com):
Sorry, I'll try to fix it on Monday.
is it a compilation problem, or how can reproduce it?I've fixed it already. There were two references to scope in phpdbg, you
probably missed it because phpdbg tests are not part of make test (but
could be).Thanks. Dmitry.
2014.11.28. 9:24 ezt írta ("Dmitry Stogov" dmitry@zend.com):
On Fri, Nov 28, 2014 at 7:33 AM, Xinchen Hui xinchen.h@zend.com
wrote:Hey:
On Fri, Nov 28, 2014 at 1:27 AM, Dmitry Stogov dmitry@zend.com
wrote:Hi,
I'm working on call/return sequence optimization. As part of this
work
I'm
minimizing the size of call frame (zend_execute_data) and number
of
read/write operations on call/return.Could you please take a look into the patch that removes EX(scope)
https://gist.github.com/dstogov/5ad50d582346385d587ecommitted.
All phpt tests are passed, but I'm not completely sure about one
line -https://gist.github.com/dstogov/5ad50d582346385d587e#file-ex_scope-05-diff-L193
On the other hand I can't imagine what it may break.
neither do I.Matteo, can you please run your test suites with this patch.
PS: I'm also going to:
- pack EX(num_args) into reserved space of EX(This)
done.
- try to get rid of EX(frame_info)
done.
- try to merge EX(called_scope) and EX(This). Only one of them
matters.- try to replace zval EX(This) with a pointer to zend_object
EX(object)Hmm, EX(This) is not like EX(object), it will be accessed by vm
handler: get_obj_zval_ptr_unusedit suppores to return a zval * there. if EX(This) became a
zend_object
*, then we may face different handlers for IS_UNUSED and other
types
:<Yes, I know. After the latest changes it doesn't make a lot of sense
to
replace ZVAL with ZEND_OBJECT*, because other data is already packed
into
the same ZVAL and it won't save any memory.Also zend_execute_data structure is aligned on zval boundary (16
bytes), so
it makes sense to save another 16 bytes, but saving 8 bytes won't
affect VM
stack memory consumption.Thanks. Dmitry.
Fyi this change broke phpdbg in master.