8000 [Cache] Improve reliability and performance of `TagAwareAdapter` by making tag versions an integral part of item value by sbelyshkin · Pull Request #42997 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Cache] Improve reliability and performance of TagAwareAdapter by making tag versions an integral part of item value #42997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[Cache] Upgrade TagAwareAdapter
  • Loading branch information
sbelyshkin committed Mar 21, 2022
commit c878e52971e78019ff736f056b0fc11f0c027f48
6 changes: 1 addition & 5 deletions src/Symfony/Component/Cache/Adapter/ProxyAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,7 @@ static function ($key, $innerItem, $poolHash) {
* @param array $item A CacheItem cast to (array); accessing protected properties requires adding the "\0*\0" PHP prefix
*/
static function (CacheItemInterface $innerItem, array $item) {
// Tags are stored separately, no need to account for them when considering this item's newly set metadata
if (isset(($metadata = $item["\0*\0newMetadata"])[CacheItem::METADATA_TAGS])) {
unset($metadata[CacheItem::METADATA_TAGS]);
}
if ($metadata) {
if ($metadata = $item["\0*\0newMetadata"]) {
// For compactness, expiry and creation duration are packed in the key of an array, using magic numbers as separators
$item["\0*\0value"] = ["\x9D".pack('VN', (int) (0.1 + $metadata[self::METADATA_EXPIRY] - self::METADATA_EXPIRY_OFFSET), $metadata[self::METADATA_CTIME])."\x5F" => $item["\0*\0value"]];
}
Expand Down
Loading
0