-
Notifications
You must be signed in to change notification settings - Fork 222
feat : Implement slot-based MGET batching for cluster clients #908
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
base: main
Are you sure you want to change the base?
feat : Implement slot-based MGET batching for cluster clients #908
Conversation
Implement slot-based MGET batching for cluster clients Co-authored-by: SoulPancake <70265851+SoulPancake@users.noreply.github.com>
Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset. In case there are security findings, they will be communicated to you as a comment inside the PR. Hope you’ll enjoy using Jit. Questions? Comments? Want to learn more? Get in touch with us. |
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.
Functionally, it works, but can we optimize allocations?
I optimised the slice mem allocation, is there any other potential improvement I can work on? @rueian |
i := 0 | ||
for _, cmd := range slotCmds { | ||
cmds.s[i] = cmd.Pin() | ||
i++ | ||
} |
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.
Can we put i into the loop?
i := 0 | ||
for _, cmd := range slotCmds { | ||
cmds.s[i] = cmd.Pin() | ||
i++ | ||
} |
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.
Can we put i into the loop?
if err := resp.NonRedisError(); err != nil { | ||
return nil, err | ||
} |
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.
if err := resp.NonRedisError(); err != nil { | |
return nil, err | |
} |
The below resp.ToArray should cover this already.
if err := resp.NonRedisError(); err != nil { | ||
return nil, err | ||
} |
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.
if err := resp.NonRedisError(); err != nil { | |
return nil, err | |
} |
The below resp.ToArray() should cover this already.
if len(slotCmds) == 0 { | ||
return ret, nil | ||
} |
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.
When could this happen?
I wonder if it is possible to avoid using |
For #844