Skip to content

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

Open
Girgias wants to merge 2 commits intophp:masterfrom
Girgias:zpp-direct-return
Open

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

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented Apr 12, 2026

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.
@Girgias Girgias force-pushed the zpp-direct-return branch from 98fa0e2 to 493796d Compare April 12, 2026 11:57
@github-actions
Copy link
Copy Markdown

AWS x86_64 (c6id.metal)

Attribute Value
Environment aws
Instance type c6id.metal
Architecture x86_64
CPU Intel(R) Xeon(R) Platinum 8375C CPU @ 2.90GHz, 64 cores @ 2900 MHz
CPU settings disabled deeper C-states, disabled turbo boost, disabled hyper-threading
RAM 251 GB
Kernel 6.12.66-88.122.amzn2023.x86_64
OS Amazon Linux 2023.10.20260202
GCC 14.2.1
Time 2026-04-12 12:20:31 UTC
Job details https://github.com/php/php-src/actions/runs/24306603609 (Artifacts)
Changeset https://github.com/php/php-src/compare/361084086d..493796d263

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

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@3610840 0.38977 0.39107 0.00028 0.07% 0.39022 0.00% 0.39017 0.00% 1.079 0.000 1.000 24.85 MB
PHP - zpp-direct-return 0.38774 0.38914 0.00028 0.07% 0.38813 -0.54% 0.38810 -0.53% 1.810 8.614 0.000 24.85 MB

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

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@3610840 0.67115 0.67527 0.00083 0.12% 0.67192 0.00% 0.67161 0.00% 2.474 0.000 1.000 25.25 MB
PHP - zpp-direct-return 0.66700 0.66862 0.00036 0.05% 0.66748 -0.66% 0.66738 -0.63% 1.026 8.614 0.000 25.24 MB

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

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@3610840 0.58703 0.59429 0.00120 0.20% 0.58773 0.00% 0.58739 0.00% 4.202 0.000 1.000 25.26 MB
PHP - zpp-direct-return 0.58748 0.59043 0.00061 0.10% 0.58827 0.09% 0.58807 0.12% 2.078 -6.980 0.000 25.20 MB

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

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@3610840 0.44508 0.44676 0.00042 0.09% 0.44590 0.00% 0.44593 0.00% 0.116 0.000 1.000 25.26 MB
PHP - zpp-direct-return 0.44529 0.44745 0.00044 0.10% 0.44613 0.05% 0.44605 0.03% 0.529 -2.327 0.020 25.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 owner April 12, 2026 13:03
@Girgias Girgias requested review from arnaud-lb and iluuu1994 April 12, 2026 13:04
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.

1 participant