Table of Contents

PHP RFC: Change how JIT is disabled by default

Introduction

This RFC proposes to change how JIT is disabled by default.

Proposal

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

For example, here are the defaults for these two configuration entries:

  opcache.jit=tracing
  opcache.jit_buffer_size=0

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

This RFC proposes to change these defaults to:

  opcache.jit=disable
  opcache.jit_buffer_size=64m

The chosen JIT buffer size default is 64 mb, a reasonable default, given that any smaller multiple of 2 causes the buffer to fill up when running moderately sized projects like Psalm or PHPStan.

Another possible option for the default is 128 mb, which is incidentally also the maximum allowed JIT buffer size on the aarch64 architecture.

Backward Incompatible Changes

This RFC does not change the default behavior, JIT was and still is disabled by default, however now it is now disabled by default using the opcache.jit setting, not the opcache.jit_buffer_size setting.

This may affect users who enabled JIT by only setting a different opcache.jit_buffer_size, without specifying a JIT mode with opcache.jit.

To enable JIT, users will also be required to populate the opcache.jit config value.

Proposed PHP Version(s)

Next PHP 8.4.

RFC Impact

To SAPIs

See Backwards Incompatible Changes section.

Proposed Voting Choices

2/3 required to accept. Voting started on 2023-12-03 and will end on 2023-12-18 00:00 GMT.

Change how JIT is disabled by default?
Real name Yes No
ashnazg (ashnazg)  
brzuchal (brzuchal)  
crell (crell)  
derick (derick)  
devnexen (devnexen)  
galvao (galvao)  
geekcom (geekcom)  
kguest (kguest)  
kocsismate (kocsismate)  
levim (levim)  
mauricio (mauricio)  
nicolasgrekas (nicolasgrekas)  
ocramius (ocramius)  
sebastian (sebastian)  
sergey (sergey)  
stas (stas)  
weierophinney (weierophinney)  
Final result: 17 0
This poll has been closed.

Patches and Tests

Pull request: https://github.com/php/php-src/pull/12678

References

Reference internals discussion: https://externals.io/message/121359