Skip to content

ZPP: return zend_string/double directly from weak function - #21737

Closed
Girgias wants to merge 2 commits into
php:masterfrom
Girgias:zpp-direct-return
Closed

ZPP: return zend_string/double directly from weak function#21737
Girgias wants to merge 2 commits into
php:masterfrom
Girgias:zpp-direct-return

Conversation

@Girgias

Copy link
Copy Markdown
Member

Both of these types provide us a sentinel value that we can use (NULL and NAN).

This idea is based on @ndossche previous PR to reduce codebloat: php#18436
This idea is based on @ndossche previous PR to reduce codebloat: php#18436
We can use NAN as a sentinel value as neither int nor string value can actually hold a NAN value.
@github-actions

Copy link
Copy Markdown

AWS x86_64 (c6id.metal)

AttributeValue
Environmentaws
Instance typec6id.metal
Architecturex86_64
CPUIntel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz, 64 cores @ 2900 MHz
CPU settingsdisabled deeper C-states, disabled turbo boost, disabled hyper-threading
RAM251 GB
Kernel6.12.66-88.122.amzn2023.x86_64
OSAmazon Linux 2023.10.20260202
GCC14.2.1
Time2026-04-12 12:20:31 UTC
Job detailshttps://github.com/php/php-src/actions/runs/24306603609 (Artifacts)
Changesethttps://github.com/php/php-src/compare/361084086d..493796d263

Laravel 12.11.0 demo app - 50 iterations, 50 warmups, 100 requests (sec)

PHPMinMaxStd devRel std dev %MeanMean diff %MedianMedian diff %SkewnessZ-statP-valueMemory
PHP - baseline@36108400.389770.391070.000280.07%0.390220.00%0.390170.00%1.0790.0001.00024.85 MB
PHP - zpp-direct-return0.387740.389140.000280.07%0.38813-0.54%0.38810-0.53%1.8108.6140.00024.85 MB

Symfony 2.8.0 demo app - 50 iterations, 50 warmups, 100 requests (sec)

PHPMinMaxStd devRel std dev %MeanMean diff %MedianMedian diff %SkewnessZ-statP-valueMemory
PHP - baseline@36108400.671150.675270.000830.12%0.671920.00%0.671610.00%2.4740.0001.00025.25 MB
PHP - zpp-direct-return0.667000.668620.000360.05%0.66748-0.66%0.66738-0.63%1.0268.6140.00025.24 MB

Wordpress 6.9 main page - 50 iterations, 20 warmups, 20 requests (sec)

PHPMinMaxStd devRel std dev %MeanMean diff %MedianMedian diff %SkewnessZ-statP-valueMemory
PHP - baseline@36108400.587030.594290.001200.20%0.587730.00%0.587390.00%4.2020.0001.00025.26 MB
PHP - zpp-direct-return0.587480.590430.000610.10%0.588270.09%0.588070.12%2.078-6.9800.00025.20 MB

bench.php - 50 iterations, 20 warmups, 2 requests (sec)

PHPMinMaxStd devRel std dev %MeanMean diff %MedianMedian diff %SkewnessZ-statP-valueMemory
PHP - baseline@36108400.445080.446760.000420.09%0.445900.00%0.445930.00%0.1160.0001.00025.26 MB
PHP - zpp-direct-return0.445290.447450.000440.10%0.446130.05%0.446050.03%0.529-2.3270.02025.20 MB

@Girgias
Girgias marked this pull request as ready for review April 12, 2026 13:03
@Girgias
Girgias requested a review from dstogov as a code ownerApril 12, 2026 13:03
@iluuu1994

Copy link
Copy Markdown
Member

Can this be closed over GH-21739 then?

@Girgias

Copy link
Copy Markdown
MemberAuthor

Can this be closed over GH-21739 then?

Yes :)

@GirgiasGirgias closed this Apr 13, 2026
@Girgias
Girgias deleted the zpp-direct-return branch April 13, 2026 13:47
Sign up for freeto 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

@Girgias@iluuu1994