On Tue, Apr 14, 2020 at 3:53 PM Sebastian Bergmann <sebast...@php.net>
wrote:

> PHP 8's JIT is currently mainly controlled through the opcache.jit
> configuration directive [1].
>
> The value for opcache.jit is currently a sequence of four digits, "5021"
> for instance. This would activate JIT optimizations based on static type
> inference and inner procedure analyses (Optimization Level), JIT
> optimization of all functions on load of the respective sourcecode file
> (Trigger), global linear-scan register allocator (Register Allocation),
> and AVX instruction generation (CPU-Specific Optimization Flags).
>
> I think that using a single configuration directive for these four
> distinct aspects of just-in-compilation is a bad idea. Many will, at least
> at first glance, mistake the value for a bitmask.
>
> I think it would be best to split up opcache.jit into five separate
> configuration directives and propose the following names:
>
> * opcache.jit for (de)activating JIT
> * opcache.jit_optimization_level for setting the optimization level
> * opcache.jit_trigger for configuring the JIT trigger
> * opcache.jit_register_allocation for configuring register allocation
> * opcache.jit_cpu_flags for configuring CPU-specific flags
>
> What do you think?
>

I have made a PR for this and added two follow up discussion points:

https://github.com/php/php-src/pull/5510

- We now have a bool opcache.jit and the "implicit" flag
opcache.jit_buffer_size which is 0 by default and leads to disabling the
JIT. Maybe we should turn these around and set opcache.jit=0 and
opcache.jit_buffer_size=16M (or whatever is a good default).

- The default for opcache.jit_trigger should be changed to 3 (profile and
jit hot functions only). This is suggested in the RFC as well.

Both changes would require tests to change, and changes to the CI setup to
make sure the build running with JIT enabled still works.


> --
> [1] https://wiki.php.net/rfc/jit#phpini_defaults
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to