Skip to content

Refactor some ext/pcre code for performance #12447

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 11 commits into from
Oct 16, 2023
Merged

Conversation

nielsdos
Copy link
Member

Gives about a 1.1-1.2% performance win on Symfony demo.
Spit over various commits with short reasoning. Once merged, can be squashed into one with the commit descriptions and titles in a single commit.

Copy link
Member

@Girgias Girgias left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +1321 to +1323
zval tmp;
ZVAL_NULL(&tmp);
zend_hash_next_index_insert_new(match_sets[i], &tmp);
Copy link
Member

Choose a reason for hiding this comment

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

We really should add zend_hash APIs to deal with those cases.
We have add_index_*() and add_assoc_*() when the array is wrapped in a zval but nothing when working with a HashTable directly.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably, but it's worth checking first if this occurs often before adding more public APIs. I don't know off the top of my head how common this is.
In any case, I'm not gonna deal with it in this PR :p

@nielsdos nielsdos merged commit 1e2e2f3 into php:master Oct 16, 2023
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