Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Feb 17, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

…ariants (#17698)

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](https://gist.github.com/arnaud-lb/2de08142dcd0c7b49caed21398f44656), when executed with `hyperfine -L version base,opt "/tmp/{version}/sapi/cli/php -d opcache.enable_cli=1 $script"`:

```
get-raw-value.php:   -58%
get-value-dyn.php:   -50%
get-value-hook.php:  -47%
get-value.php:       -59%
is-initialized.php:  -59%
set-value.php:       -11%
```

And a 1.8% decrease in this Doctrine benchmark: arnaud-lb/symfony-demo@5058252...reflection-property-get-value-opt
@pull pull bot added the ⤵️ pull label Feb 17, 2025
@pull pull bot merged commit 8af9042 into wudi:master Feb 17, 2025
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