Skip to content

Avoid useless initializations of fci/fcc in array functions #18273

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

Merged
merged 1 commit into from
Apr 15, 2025

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Apr 7, 2025

These cause cache misses due to global access, in phpstan (notably the array_map).
Initializing these isn't necessary because ZPP initializes it for us. Only for optional arguments do we need to be careful; for array_filter we still reset the fci but not fci_cache because fci is not necessarily set by ZPP but is conditionally used to access fci_cache.

These cause cache misses due to global access, in phpstan
(notably the array_map).
Initializing these isn't necessary because ZPP initializes it for us.
Only for optional arguments do we need to be careful; for `array_filter`
we still reset the `fci` but not `fci_cache` because `fci` is not
necessarily set by ZPP but is conditionally used to access `fci_cache`.
@nielsdos nielsdos marked this pull request as ready for review April 8, 2025 20:35
@nielsdos nielsdos requested a review from bukka as a code owner April 8, 2025 20:35
iluuu1994 added a commit to iluuu1994/php-src that referenced this pull request Apr 14, 2025
See php#18273, a constant may cause
unnecessary cache misses.
Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just realized I never actually approved this. I checked all the cases again and this looks correct to me.

iluuu1994 added a commit that referenced this pull request Apr 15, 2025
See #18273, a constant may cause
unnecessary cache misses.

Closes GH-18326
@nielsdos nielsdos merged commit ea387fc into php:master Apr 15, 2025
9 of 17 checks passed
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.

2 participants