-
Notifications
You must be signed in to change notification settings - Fork 78
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
[Refactor] Improve errors.Join performance #2010
Conversation
Signed-off-by: kpango <kpango@vdaas.org>
[CHATOPS:HELP] ChatOps commands.
|
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.
LGTM
Signed-off-by: kpango <kpango@vdaas.org>
Deploying with Cloudflare Pages
|
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #2010 +/- ##
==========================================
- Coverage 29.51% 29.46% -0.05%
==========================================
Files 366 366
Lines 34532 34559 +27
==========================================
- Hits 10192 10184 -8
- Misses 23917 23948 +31
- Partials 423 427 +4
... and 7 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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.
LGTM
[FOSSA] The scan result will be available at https://app.fossa.com/projects/custom%2B21465%2Fvald/refs/branch/refactor%2Ferrors%2Fimprove-errors-join-performance/b98169dafe39a672c2edafcb27e380b8149df322 |
Profile Report
|
b2cdada
to
ccd4f81
Compare
internal/slices/slices_test.go
Outdated
|
||
func TestSortStableFunc(t *testing.T) { | ||
type args struct { | ||
x []E |
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.
typecheck: undefined: E
❗❗ 2 similar findings have been found in this PR
🔎 Expand here to view all instances of this finding
File Path | Line Number |
---|---|
internal/slices/slices_test.go | 197 |
internal/slices/slices_test.go | 279 |
Visit the Lift Web Console to find more details in your report.
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Help us improve LIFT! (Sonatype LiftBot external survey)
Was this a good recommendation for you? Answering this survey will not impact your Lift settings.
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
ccd4f81
to
66b3d38
Compare
Signed-off-by: kpango <kpango@vdaas.org>
66b3d38
to
1331c00
Compare
return nil | ||
} | ||
tests := []test{ | ||
// TODO test cases |
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.
godox: internal/slices/slices_test.go:303: Line contains TODO/BUG/FIXME: "TODO test cases"
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Help us improve LIFT! (Sonatype LiftBot external survey)
Was this a good recommendation for you? Answering this survey will not impact your Lift settings.
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
}, | ||
*/ | ||
|
||
// TODO test cases |
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.
godox: internal/slices/slices_test.go:322: Line contains TODO/BUG/FIXME: "TODO test cases"
ℹ️ Expand to see all @sonatype-lift commands
You can reply with the following commands. For example, reply with @sonatype-lift ignoreall to leave out all findings.
Command | Usage |
---|---|
@sonatype-lift ignore |
Leave out the above finding from this PR |
@sonatype-lift ignoreall |
Leave out all the existing findings from this PR |
@sonatype-lift exclude <file|issue|path|tool> |
Exclude specified file|issue|path|tool from Lift findings by updating your config.toml file |
Note: When talking to LiftBot, you need to refresh the page to see its response.
Click here to add LiftBot to another repo.
Help us improve LIFT! (Sonatype LiftBot external survey)
Was this a good recommendation for you? Answering this survey will not impact your Lift settings.
[ 🙁 Not relevant ] - [ 😕 Won't fix ] - [ 😑 Not critical, will fix ] - [ 🙂 Critical, will fix ] - [ 😊 Critical, fixing now ]
sb.Reset() | ||
sbPool.Put(sb) | ||
}() | ||
sb.Grow(len(e.errs) * 16) |
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.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 16, in detected (gomnd)
var ( | ||
mu sync.Mutex | ||
emu sync.Mutex | ||
errs = make([]error, 0, concurrency*2) // concurrency * recv+send |
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.
🚫 [golangci] reported by reviewdog 🐶
mnd: Magic number: 2, in detected (gomnd)
[FOSSA] The scan result will be available at https://app.fossa.com/projects/custom%2B21465%2Fvald/refs/branch/refactor%2Ferrors%2Fimprove-errors-join-performance/79d39deb4bcb25d0e56dffc452919858c7c85d2b |
Profile Report
|
Description:
Since errors.Is was used to evaluate the equality of errors in errors.Join for the 0th and subsequent errors, performance problems occurred exponentially depending on the length of the errors.
By eliminating the evaluation of errors.Is, I have confirmed that performance can be improved.
Related Issue:
Versions:
Checklist:
Special notes for your reviewer: