[RFC] Add ext-user_cache bundled extension#22730
Open
zeriyoshi wants to merge 11 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RFC: WIP
This PR introduces a new built-in extension,
ext-user_cache, to PHP.It replaces the earlier
OPcache Static Cache(#22534) andOPcache User Cache(#22052) proposals.It is a refined version whose design has been completely rethought and reimplemented from scratch, rather than carried over from the previous proposals.
The previous discussion of the OPcache Static Cache can be found on the internals mailing list (externals.io): https://externals.io/message/130912
ext-user_cacheprovides high-performance caching that persists across request boundaries.Values are stored in and retrieved from pre-allocated shared memory (SHM) through one of the following paths:
ext-date,ext-spl) are converted to a shared graph representation and copied.__serializeare serialized with a fast internal serializer and then copied.The extension is enabled by default and enforces appropriate security boundaries for each SAPI. Even when it is disabled, libraries can continue to use it transparently; they simply gain no caching benefit.
The extension is designed specifically for fetch-heavy workloads, so its write performance is lower than that of existing third-party extensions. However, I believe this trade-off is acceptable given the nature of caching.
Detailed benchmarks and their test suites are available here: