Re: opcache.jit directive should be split up
| From: | tyson andre | Date: | Sat, 02 May 2020 13:59:10 +0000 |
| Subject: | Re: opcache.jit directive should be split up | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-109964@lists.php.net to get a copy of this message | ||
Hi Benjamin,
> > 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
> >
> > ...
>
> - 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).
I'd agree with that - I keep forgetting that
opcache.jit isn't a boolean.
To avoid confusion with the RFC and to be consistent with opcache.enable and
opcache.enable_cli,
I'd prefer opcache.enable_jit={0,1} over opcache.jit.
Also, people who are reading a php.ini would not remember what
opcache.jit_optimization_level=1 means.
Maybe supporting aliases for the 4 integer flags would be useful.
(opcache.jit_optimization_level={no,minimal,selective_inlining,jit_optimize_3,jit_optimize_4,jit_optimize_5|full})
- I can't think of a good name for 3-5. Also, it's possible that even more aggressive
settings may be added in the future.
- Emit a startup error (or warn and use the default) if the alias or number is unrecognized.
One possibility I thought of is to default the jit_buffer_size to a multiple of
opcache.memory_consumption,
which might be a reasonable default in most use cases.
(Large codebases would get a large buffer, tiny scripts would get a small buffer).
I'm not sure what that multiple should be or if there'd be a minimum that should be
enforced.
- If opcache.memory_consumption is somehow set to 0 or negative (file_cache_only?), maybe go with a
default such as 16M.
Thanks,
- Tyson