-
Notifications
You must be signed in to change notification settings - Fork 175
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
create snapshot map with multiple goroutines #5646
create snapshot map with multiple goroutines #5646
Conversation
IDK if this applies here, but maybe just to be safe, does maybe https://github.com/onflow/flow-go/pull/5488/files apply here? Could we check this isn't also an issue here? |
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.
Great work!
Might be good to get more eyes on it. Also, it would be great to test this exhaustively with the race detector on.
1871375
to
0122f72
Compare
There was an unrelated data race issue in a test. The |
0122f72
to
5b85aeb
Compare
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.
Nice! I left a suggestion to avoid goroutine overhead of paring and merging when workers == 2
in two functions.
}(start, payloads[start:end]) | ||
|
||
} | ||
|
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.
Maybe have a shortcut here if workers == 2
to avoid goroutine overhead of paring and merging mini maps.
Same comment for createLargeMap()
.
if workers == 2 {
left := <-minimaps
if left.err != nil {
return nil, left.err
}
right := <-minimaps
if right.err != nil {
return nil, right.err
}
maps.Copy(left.minimap, right.minimap)
return left.minimap, 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.
Looks like this was addressed in aea4edc
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/stable-cadence #5646 +/- ##
==========================================================
+ Coverage 53.33% 60.18% +6.85%
==========================================================
Files 324 541 +217
Lines 30045 53624 +23579
==========================================================
+ Hits 16024 32276 +16252
- Misses 12598 19004 +6406
- Partials 1423 2344 +921
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This is updated PR #5588