-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Generated arginfo header files: use known strings for prop names when… #15751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… possible Instead of allocating, using, and then releasing a zend_string for every property name unconditionally, only do so when the minimum supported version of PHP does not have that string in its known strings (ZEND_KNOWN_STRINGS). If the string is already known, just use the known version directly. This is already done for some non-generated class registrations, e.g. in `zend_enum_register_props()`.
ac1684e
to
0a146f0
Compare
@kocsismate would you mind taking another look? No objections from other reviewers. |
Sorry for the delay... But I've rechecked it. I'll approve it once the comments are addressed. |
Drop spaces from brackets, don't hard code latest version
No worries, comments have been addressed |
@kocsismate I see that you approved this patch - would you mind also merging it? I don't have the permissions to do so myself |
do we expect a measurable memory optimization from this PR? If so, any approximation? |
I was wondering about the same question first (#15751 (comment)), and my estimation is that it has negligible improvements. |
php#15751) Instead of allocating, using, and then releasing a zend_string for every property name unconditionally, only do so when the minimum supported version of PHP does not have that string in its known strings (ZEND_KNOWN_STRINGS). If the string is already known, just use the known version directly. This is already done for some non-generated class registrations, e.g. in `zend_enum_register_props()`.
I forgot a `$this->` in php#15751
I forgot a `$this->` in #15751
… possible
Instead of allocating, using, and then releasing a zend_string for every property name unconditionally, only do so when the minimum supported version of PHP does not have that string in its known strings (ZEND_KNOWN_STRINGS). If the string is already known, just use the known version directly. This is already done for some non-generated class registrations, e.g. in
zend_enum_register_props()
.