Skip to content

Use zend_string_release_ex() in concat_function() #18827

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
Jun 12, 2025

Conversation

nielsdos
Copy link
Member

The strings we encounter are either interned in which case the persistent bool doesn't matter; or they're temporary as the code already assumes that anyway.
This patch shrinks the function from 3332 bytes to 3173 bytes on x86-64 with GCC 15.1.1.

The strings we encounter are either interned in which case the
persistent bool doesn't matter; or they're temporary as the code already
assumes that anyway.
This patch shrinks the function from 3332 bytes to 3173 bytes on x86-64
with GCC 15.1.1.
@staabm
Copy link
Contributor

staabm commented Jun 12, 2025

do I assume right, that reduction in code-size of concat_function() will result in php-src beeing more efficient in userland string concatenations?

or does this PR targets a different goal?

@nielsdos nielsdos merged commit 28a083b into php:master Jun 12, 2025
9 checks passed
@nielsdos
Copy link
Member Author

This could have a theoretical performance impact if your application does a lot of concats and suffers from instruction cache pressure. Most apps don't though. Still it's nice to clean up machine code bloat.

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.

3 participants