# Change default method of disabling JIT for PHP 8.4

- Thread: https://externals.io/message/121359
- Original archive: https://news-web.php.net/php.internals/121359
- Started by Daniil Gentili on 2023-10-17T17:46:24+00:00
- Messages: 8
- RFC: Change how JIT is disabled by default (Implemented (PHP 8.4)) — https://externals.io/rfc/jit_config_defaults.md
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #121359 — Daniil Gentili — 2023-10-17T17:46:24+00:00

URL: https://externals.io/message/121359#121359

Hello,

I would like to submit an RFC and PR to change a few INI defaults for 
opcache, changing how JIT is disabled by default.

Currently, JIT is disabled by default using the 
|opcache.jit_buffer_size=0| default, instead of |opcache.jit=0|.

I.e. here are the defaults for these two configuration entries:

- opcache.jit=tracing
- opcache.jit_buffer_size=0

This effectively disables JIT not because `jit=0`, but rather because 
the buffer size is set to 0.

I would like to change these defaults to:

- opcache.jit=off
- opcache.jit_buffer_size=64m (taken from 
https://github.com/php/php-src/pull/12425/files, any smaller multiple of 
2 causes the buffer to fill up when running moderately sized projects 
like Psalm or PHPStan).

What do you think?


Kind regards,

Daniil Gentili.

---

## #121365 — Jorg Sowa — 2023-10-17T21:19:20+00:00

URL: https://externals.io/message/121359#121365 · In reply to: #121359

Hello Daniil,
I like this proposition. I never understood why the JIT is disabled by the
ini setting `buffer_size` rather than other simple 'switch' like setting.

Kind regards,
Jorg

---

## #121369 — Christian Schneider — 2023-10-18T06:52:19+00:00

URL: https://externals.io/message/121359#121369 · In reply to: #121359

Am 17.10.2023 um 19:46 schrieb Daniil Gentili <daniil@daniil.it>:
> I would like to submit an RFC and PR to change a few INI defaults for opcache, changing how JIT is disabled by default.
> 
> Currently, JIT is disabled by default using the |opcache.jit_buffer_size=0| default, instead of |opcache.jit=0|.
> 
> I would like to change these defaults to:
> 
> - opcache.jit=off
> - opcache.jit_buffer_size=64m (taken from https://github.com/php/php-src/pull/12425/files, any smaller multiple of 2 causes the buffer to fill up when running moderately sized projects like Psalm or PHPStan).

I understand your point but it might unexpectedly switch behavior for people just setting jit_buffer_size and expecting this to turn JIT on.
While (in the light of a new upcoming JIT)  this might not be a big deal it is also not clear if it is worth it.
Maybe the settings can be overhauled once the new JIT is introduced (which might have different settings anyway).

Regards,
- Chris

---

## #121374 — Daniil Gentili — 2023-10-18T08:42:38+00:00

URL: https://externals.io/message/121359#121374 · In reply to: #121369

Hi,

This is precisely why I'm planning to submit the RFC to make the change 
in PHP 8.4, which is when the new JIT will be introduced.

Regards,

Daniil.


> Am 17.10.2023 um 19:46 schrieb Daniil Gentili <daniil@daniil.it>:
> > […]
> I understand your point but it might unexpectedly switch behavior for people just setting jit_buffer_size and expecting this to turn JIT on.
> While (in the light of a new upcoming JIT)  this might not be a big deal it is also not clear if it is worth it.
> Maybe the settings can be overhauled once the new JIT is introduced (which might have different settings anyway).
>
> Regards,
> - Chris

---

## #121375 — Christian Schneider — 2023-10-18T10:17:57+00:00

URL: https://externals.io/message/121359#121375 · In reply to: #121374

Am 18.10.2023 um 10:42 schrieb Daniil Gentili <daniil@daniil.it>:
> This is precisely why I'm planning to submit the RFC to make the change in PHP 8.4, which is when the new JIT will be introduced.

Ah, I missed that part, my bad. I'd suggest mentioning this in the RFC.
I also went back Dmitry's RFC and saw that no change on default ini settings is planned from his side.

Regards,
- Chris

---

## #121377 — Dmitry Stogov — 2023-10-18T11:06:30+00:00

URL: https://externals.io/message/121359#121377 · In reply to: #121359

> Hello,
>
> I would like to submit an RFC and PR to change a few INI defaults for
> opcache, changing how JIT is disabled by default.
>
> Currently, JIT is disabled by default using the
> |opcache.jit_buffer_size=0| default, instead of |opcache.jit=0|.
>
> I.e. here are the defaults for these two configuration entries:
>
> - opcache.jit=tracing
> - opcache.jit_buffer_size=0
>
> This effectively disables JIT not because `jit=0`, but rather because
> the buffer size is set to 0.
>
> I would like to change these defaults to:
>
> - opcache.jit=off
> - opcache.jit_buffer_size=64m (taken from
> https://github.com/php/php-src/pull/12425/files, any smaller multiple of
> 2 causes the buffer to fill up when running moderately sized projects
> like Psalm or PHPStan).
>
> What do you think?
>

Actually, now opcache.jit=0/off/no/false doesn't disable JIT completely. It
makes PHP start requests with JIT disabled, but this may be changed during
the request.
JIT may be disabled completely by opcache.jit=disable

Thanks. Dmitry.


>
>
> Kind regards,
>
> Daniil Gentili.

---

## #121679 — Daniil Gentili — 2023-11-15T17:07:25+00:00

URL: https://externals.io/message/121359#121679 · In reply to: #121359

Hi all, I've created the actual RFC: 
https://wiki.php.net/rfc/jit_config_defaults

Regards,

Daniil Gentili.

---

## #121688 — Larry Garfield — 2023-11-15T21:00:49+00:00

URL: https://externals.io/message/121359#121688 · In reply to: #121679

> Hi all, I've created the actual RFC: 
> https://wiki.php.net/rfc/jit_config_defaults
>
> Regards,
>
> Daniil Gentili.

Seems like an obvious usability win to me.  +1

--Larry Garfield
