Re: [Proposal] OPcache: share identical opcode arrays between cached scripts (opcache.enable_dedup)
| From: | Arnaud Le Blanc | Date: | Mon, 23 Nov 2026 13:16:36 +0000 |
| Subject: | Re: [Proposal] OPcache: share identical opcode arrays between cached scripts (opcache.enable_dedup) | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-133200@lists.php.net to get a copy of this message | ||
Hi Jean-Christophe,
On Tue, Nov 10, 2026 at 10:00 AM jc@vitalyn.com <jc@vitalyn.com> wrote:
> 1. Is a PR with discussion enough, or do you want an RFC for a new
> opt-in INI directive?
Thank you for the detailed write-up and numbers.
This is mostly a technical change, so it can be discussed directly in a PR
without an RFC. That said, I have a few concerns:
* The results are impressive for this use-case, but this adds complexity
to an already complex part of the code base. Unless it benefits more
general setups, I'm not sure the maintenance cost is worth it.
* It breaks the assumption that two functions with the same opcodes are
the same function, which we rely on in a few places (e.g. trait linking,
phpdbg breakpoints, PFA caching, Closure::__invoke).
* It adds more constraints to future work (the feature being mutually
exclusive with JIT and the file cache illustrates that).
* As the security review shows in "Step 3", under the stated pre-existing
capabilities a tenant can break into others. I wouldn't recommend sharing
the same SHM segments between tenants.
Best Regards,
Arnaud