Skip to content

Implement fast-path static property access in JIT - #25042

Open
ndossche wants to merge 2 commits into
php:masterfrom
ndossche:jit-static-prop
Open

ndossche wants to merge 2 commits into
php:masterfrom
ndossche:jit-static-prop

Conversation

@ndossche

@ndossche ndossche commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

This includes the fix from phpGH-25041.
This is common for OOP applications, in particularly noticed in the
Laravel framework.
@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.18.56-125.164.amzn2023.x86_64
OS Amazon Linux 2023.12.20261026
GCC 14.2.1
Binary layout strategy bolt-align
Time 2026-10-29 20:22:55 UTC
Job details https://github.com/php/php-src/actions/runs/40948472267 (Artifacts)
Changeset https://github.com/php/php-src/compare/ed255aed9e..9178d22367

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@ed255ae 0.37907 0.37974 0.00015 0.04% 0.37941 0.00% 0.37943 0.00% -0.059 0.000 1.000 31.33 MB
PHP - baseline@ed255ae (JIT) 0.35538 0.35644 0.00025 0.07% 0.35578 -6.23% 0.35574 -6.24% 0.668 8.614 0.000 31.38 MB
PHP - jit-static-prop 0.37934 0.38135 0.00031 0.08% 0.37975 0.09% 0.37968 0.07% 3.152 -6.970 0.000 31.32 MB
PHP - jit-static-prop (JIT) 0.35182 0.35266 0.00022 0.06% 0.35215 -7.18% 0.35211 -7.20% 0.616 8.614 0.000 31.79 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@ed255ae 0.68830 0.69259 0.00062 0.09% 0.68910 0.00% 0.68902 0.00% 3.799 0.000 1.000 31.80 MB
PHP - baseline@ed255ae (JIT) 0.65073 0.65276 0.00041 0.06% 0.65131 -5.48% 0.65125 -5.48% 1.259 8.614 0.000 31.85 MB
PHP - jit-static-prop 0.68853 0.69052 0.00039 0.06% 0.68917 0.01% 0.68910 0.01% 1.207 -1.424 0.155 31.78 MB
PHP - jit-static-prop (JIT) 0.65060 0.65254 0.00046 0.07% 0.65126 -5.49% 0.65112 -5.50% 1.000 8.614 0.000 31.79 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@ed255ae 0.59772 0.59932 0.00040 0.07% 0.59829 0.00% 0.59820 0.00% 0.870 0.000 1.000 31.78 MB
PHP - baseline@ed255ae (JIT) 0.52403 0.52611 0.00043 0.08% 0.52461 -12.31% 0.52451 -12.32% 1.453 8.614 0.000 31.83 MB
PHP - jit-static-prop 0.59819 0.60060 0.00044 0.07% 0.59873 0.07% 0.59863 0.07% 2.265 -5.129 0.000 31.76 MB
PHP - jit-static-prop (JIT) 0.52294 0.52680 0.00057 0.11% 0.52394 -12.43% 0.52380 -12.44% 2.898 8.614 0.000 31.83 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@ed255ae 0.45159 0.45459 0.00063 0.14% 0.45331 0.00% 0.45335 0.00% -0.264 0.000 1.000 31.79 MB
PHP - baseline@ed255ae (JIT) 0.14378 0.14417 0.00009 0.06% 0.14397 -68.24% 0.14396 -68.24% 0.021 8.614 0.000 31.85 MB
PHP - jit-static-prop 0.45285 0.45493 0.00053 0.12% 0.45377 0.10% 0.45364 0.06% 0.309 -3.523 0.000 31.78 MB
PHP - jit-static-prop (JIT) 0.14371 0.14413 0.00010 0.07% 0.14395 -68.25% 0.14395 -68.25% -0.083 8.614 0.000 31.85 MB

@ndossche

Copy link
Copy Markdown
Member Author

So the bolt-align based bench shows a surprising improvement. Of course that's the most optimistic case.
Another future simple step would be to support static:: in calls.

@ndossche
ndossche requested a review from arnaud-lb October 29, 2026 21:08
&& ((opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_SELF
|| (opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT))))) {
|| (opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_PARENT
|| (opline->op2.num & ZEND_FETCH_CLASS_MASK) == ZEND_FETCH_CLASS_STATIC))))) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not see any test - is there any way, like opcache dump, to dump the JIT and unit test this?

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