Skip to content

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

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

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.
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