Skip to content
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

Use new ZPP and inline caches in ReflectionProperty::getValue() and variants #17698

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

arnaud-lb
Copy link
Member

@arnaud-lb arnaud-lb commented Feb 4, 2025

Apply the following changes to ReflectionProperty::getValue(), ::getRawValue(), ::isInitialized(), ::setValue(), ::setRawValue():

  • Pass a cache slot to the property handler
  • Inline the simple case of fetching a declared property
  • Use the new parameter parsing API

This results in run time decrease of 12% to 59% in micro benchmarks:

get-value.php:       -59%
get-value-hook.php:  -46%
get-value-dyn.php:   -52%
get-raw-value.php:   -56%
is-initialized.php:  -60%
set-value.php:       -12%

And a 1.8% decrease in this Doctrine benchmark: arnaud-lb/symfony-demo@5058252...reflection-property-get-value-opt

…ized(), ::setValue(), ::setRawValue()

- Pass a cache slot to the property handler
- Inline the simple case of fetching a declared property
- Use the new parameter parsing API

This makes these methods 12% to 60% faster.

Using the new parameter parsing API had the most impact, by far.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant