-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
tscache: fix perf regression by avoiding expensive error checks #49324
Conversation
This code was previously using errors.Is in cases where it can be avoided by first checking if err != nil. Release note: None (regression was not part of a release)
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.
Thanks for bringing this up.
I am worried about the fact this is required -- the case where err == nil
should be fast in errors.Is
already. If it's not, that's a bug in errors.Is
.
I'll have a look.
Here's your fix: cockroachdb/errors#33 |
I think this will do it: #49356 |
49356: deps: bump cockroachdb/errors r=tbg a=knz This fixes a perf regression introduced in d88ac05. (Regression found by @asubiotto ) Supersedes #49324 Release note: None Co-authored-by: Raphael 'kena' Poss <[email protected]>
can you try your benchmark again now that #49356 is merged? |
Yup! Looks good:
|
This code was previously using errors.Is in cases where it can be avoided by
first checking if err != nil.
Release note: None (regression was not part of a release)
Benchmark results here