Skip to content

Make strtolower()/strtoupper() frameless - #23084

Closed
staabm wants to merge 1 commit into
php:masterfrom
staabm:frameless
Closed

Make strtolower()/strtoupper() frameless#23084
staabm wants to merge 1 commit into
php:masterfrom
staabm:frameless

Conversation

@staabm

@staabm staabm commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

disclaimer: this change was generated by claude opus. I have little experience with php-src development


Both are single-argument wrappers around zend_string_tolower/upper; static analyzers and general string handling call them at very high frequency. The frameless call convention removes the call frame setup and argument copying.


benchmark (3 runs after 2 warmup runs):

run /Users/staabm/workspace/php-src/sapi/cli/php bin/phpstan clear-result-cache -q && /Users/staabm/workspace/php-src/sapi/cli/php -d memory_limit=450M bin/phpstan -v after checking out phpstan/phpstan-src#5942 from the git root folder.
(on first time phpstan-src checkout you need composer install and make to prepare the codebase)

before this PR:
14.39s
14.44s
14.36s

after this PR:
14.18s
14.14s
14.12s

on M4-Pro with macOS 26.6 (25G72)

Both are single-argument wrappers around zend_string_tolower/upper;
static analyzers and general string handling call them at very high
frequency. The frameless call convention removes the call frame setup
and argument copying.
@staabm

staabm commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

@iluuu1994 do you have a opinion on this frameless topic?

@iluuu1994

Copy link
Copy Markdown
Member

@staabm Sorry, didn't get to it yet. But looks reasonable.

@iluuu1994 iluuu1994 closed this in 89a1725 Aug 12, 2026
@iluuu1994

Copy link
Copy Markdown
Member

Thanks @staabm and @ondrejmirtes!

@staabm
staabm deleted the frameless branch August 12, 2026 15:19
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