Skip to content

JIT: Add fast path for object arguments in RECV - #24052

Merged
ndossche merged 2 commits into
php:masterfrom
ndossche:jit-faster-recv
Oct 2, 2026
Merged

ndossche merged 2 commits into
php:masterfrom
ndossche:jit-faster-recv

Conversation

@ndossche

@ndossche ndossche commented Oct 1, 2026

Copy link
Copy Markdown
Member

No description provided.

@ndossche

ndossche commented Oct 1, 2026 •

Copy link
Copy Markdown
Member Author

CI Failures (so far) are unrelated

@github-actions

github-actions Bot commented Oct 1, 2026

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.38-76.139.amzn2023.x86_64
OS Amazon Linux 2023.12.20260727
GCC 14.2.1
Binary layout strategy none
Time 2026-10-01 19:11:57 UTC
Job details https://github.com/php/php-src/actions/runs/36912452986 (Artifacts)
Changeset https://github.com/php/php-src/compare/b205b6f879..c4d5d96cb0

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@b205b6f 0.37888 0.37976 0.00019 0.05% 0.37934 0.00% 0.37931 0.00% 0.300 0.000 1.000 26.20 MB
PHP - baseline@b205b6f (JIT) 0.35637 0.35869 0.00039 0.11% 0.35687 -5.92% 0.35675 -5.95% 2.611 8.614 0.000 26.28 MB
PHP - jit-faster-recv 0.37957 0.38036 0.00018 0.05% 0.37985 0.14% 0.37983 0.14% 0.747 -8.193 0.000 25.89 MB
PHP - jit-faster-recv (JIT) 0.35579 0.35731 0.00025 0.07% 0.35621 -6.10% 0.35614 -6.11% 2.061 8.614 0.000 25.97 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@b205b6f 0.67690 0.67892 0.00051 0.08% 0.67752 0.00% 0.67734 0.00% 1.366 0.000 1.000 26.24 MB
PHP - baseline@b205b6f (JIT) 0.64641 0.66452 0.00318 0.49% 0.64780 -4.39% 0.64696 -4.49% 4.132 8.614 0.000 26.28 MB
PHP - jit-faster-recv 0.67353 0.69101 0.00241 0.36% 0.67446 -0.45% 0.67407 -0.48% 6.838 8.269 0.000 26.20 MB
PHP - jit-faster-recv (JIT) 0.64182 0.66709 0.00405 0.63% 0.64314 -5.07% 0.64228 -5.18% 5.233 8.614 0.000 26.21 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@b205b6f 0.59445 0.60369 0.00148 0.25% 0.59547 0.00% 0.59508 0.00% 3.965 0.000 1.000 26.34 MB
PHP - baseline@b205b6f (JIT) 0.52151 0.52475 0.00069 0.13% 0.52240 -12.27% 0.52224 -12.24% 2.130 8.614 0.000 26.20 MB
PHP - jit-faster-recv 0.59489 0.60358 0.00142 0.24% 0.59589 0.07% 0.59549 0.07% 3.777 -3.754 0.000 26.24 MB
PHP - jit-faster-recv (JIT) 0.52056 0.52338 0.00055 0.11% 0.52133 -12.45% 0.52123 -12.41% 1.127 8.614 0.000 26.32 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@b205b6f 0.45155 0.45503 0.00078 0.17% 0.45349 0.00% 0.45336 0.00% -0.098 0.000 1.000 26.34 MB
PHP - baseline@b205b6f (JIT) 0.14365 0.14466 0.00023 0.16% 0.14419 -68.20% 0.14422 -68.19% -0.154 8.614 0.000 26.20 MB
PHP - jit-faster-recv 0.45166 0.45554 0.00072 0.16% 0.45341 -0.02% 0.45327 -0.02% 0.514 0.717 0.473 26.24 MB
PHP - jit-faster-recv (JIT) 0.14356 0.14464 0.00023 0.16% 0.14418 -68.21% 0.14419 -68.19% -0.373 8.614 0.000 26.32 MB

micro_bench.php - 50 iterations, 5 warmups, 1 request (sec)

PHP Min Max Std dev Rel std dev % Mean Mean diff % Median Median diff % Skewness Z-stat P-value Memory
PHP - baseline@b205b6f 1.27919 1.29615 0.00405 0.31% 1.28747 0.00% 1.28775 0.00% 0.191 0.000 1.000 26.34 MB
PHP - baseline@b205b6f (JIT) 0.56692 0.59428 0.00620 1.07% 0.57771 -55.13% 0.57679 -55.21% 0.686 8.614 0.000 26.20 MB
PHP - jit-faster-recv 1.27985 1.29703 0.00352 0.27% 1.28863 0.09% 1.28870 0.07% -0.218 -1.665 0.096 26.24 MB
PHP - jit-faster-recv (JIT) 0.57096 0.59951 0.00588 1.01% 0.58164 -54.82% 0.58133 -54.86% 0.782 8.614 0.000 26.32 MB

@arnaud-lb arnaud-lb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks great!

As a follow-up, I think that we could remove the type_mask branch in zend_jit_verify_arg_type() when type == IS_OBJECT and the type_mask doesn't contain MAY_BE_OBJECT.

Comment thread ext/opcache/jit/zend_jit_ir.c Outdated
static bool zend_jit_class_is_persistent(const zend_class_entry *ce)
{
if (ce->type == ZEND_INTERNAL_CLASS) {
#ifdef _WIN32

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: I know this is a copy/paste, but we should really use ZEND_OPCACHE_SHM_REATTACHMENT here

Comment thread ext/opcache/jit/zend_jit_ir.c Outdated
{
if (ce->type == ZEND_INTERNAL_CLASS) {
#ifdef _WIN32
/* ASLR, see zend_jit_class_may_be_modified() */

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo:

Suggested change
/* ASLR, see zend_jit_class_may_be_modified() */
/* ASLR, see zend_jit_may_be_modified() */

@ndossche
ndossche merged commit a8135c8 into php:master Oct 2, 2026
18 checks passed
@ndossche

ndossche commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

Thanks @arnaud-lb
I will think about your suggestions. I had something else of work already started so I will first PR that other work before I work on your suggestions.

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