-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Cache] Improve perf of array-based pools #27563
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
Conversation
05b84b1
to
995cc8d
Compare
(failure is a false-positive.) |
$value = serialize($value); | ||
} | ||
} elseif (null !== $value && !\is_scalar($value)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't null
be serialized too ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, fixed
995cc8d
to
657d8c7
Compare
@nicolas-grekas it seems to duplicate the same logic in ArrayAdapter and ArrayCache. Should part of it be moved to the ArrayTrait to be shared ? |
7ce8c1d
to
8bb8e83
Compare
@stof done |
8bb8e83
to
28981c4
Compare
28981c4
to
92a2d47
Compare
PR ready |
Thank you @nicolas-grekas. |
…kas) This PR was merged into the 4.2-dev branch. Discussion ---------- [Cache] Improve perf of array-based pools | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - - skip key validation when key is already known - remove overhead in `ArrayCache::get()` via inlining - don't store simple values in serialized format when not needed, preserving COW ~~Needs #27565 to be green.~~ Commits ------- 92a2d47 [Cache] Improve perf of array-based pools
This PR was merged into the 4.2 branch. Discussion ---------- [Cache] Fix undefined variable in ArrayTrait | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | After upgrading my project to 4.2 my tests failed with a message that `$key` variable is missing here: https://github.com/symfony/symfony/blob/e81285249b780a11ed209a79fa77c1f6ea6da67b/src/Symfony/Component/Cache/Traits/ArrayTrait.php#L131 which seems to be introduced with PR #27563. So I added that variable to the trait and method calls (are there any other?). This is internal class so I guess noone is using it anywhere. Anyway, my tests pass with this fix. Commits ------- b0b5937 Fix undefined variable in cache ArrayTrait
This PR was merged into the 4.2 branch. Discussion ---------- [Cache] Fix undefined variable in ArrayTrait | Q | A | ------------- | --- | Branch? | 4.2 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | After upgrading my project to 4.2 my tests failed with a message that `$key` variable is missing here: https://github.com/symfony/symfony/blob/e81285249b780a11ed209a79fa77c1f6ea6da67b/src/Symfony/Component/Cache/Traits/ArrayTrait.php#L131 which seems to be introduced with PR symfony/symfony#27563. So I added that variable to the trait and method calls (are there any other?). This is internal class so I guess noone is using it anywhere. Anyway, my tests pass with this fix. Commits ------- b0b5937d1d Fix undefined variable in cache ArrayTrait
ArrayCache::get()
via inliningNeeds #27565 to be green.