-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Fast multiple setEx with the pipeline transcation (RedisAdapter::doSave) #18248
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
Q | A |
---|---|
Branch? | master |
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | no |
Fixed tickets | - |
License | MIT |
Doc PR | - |
foreach ($serialized as $id => $v) { | ||
$this->redis->expire($id, $lifetime); | ||
if ($lifetime > 0) { | ||
$pipe = $this->redis->multi(Redis::PIPELINE); |
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.
missing \
: \Redis
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.
Ok, fixed.
did you profile how much faster it is? |
Yes. The new method is faster in ~4 times. |
Is it possible to have a Backfire profile of it? |
👍 |
5 values: https://blackfire.io/profiles/6a1e8027-1375-4a93-b46e-14ccbc2c639a/graph 100Kb per value:
|
@masterklavi what we would need is a backfire comparison between profiles of the old code and the new code. This would be much easier to analyze than some code running both methods one after the other with different names. |
Thank you @masterklavi. |