-
Notifications
You must be signed in to change notification settings - Fork 232
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
Improved staging shard performance #2034
Conversation
8dc4c0f
to
7de4ede
Compare
@@ -51,8 +52,16 @@ func (sa *StagingArea) Commit(dbTx DBTransaction) error { | |||
return errors.New("Attempt to call Commit on already committed stagingArea") | |||
} | |||
|
|||
for _, shard := range sa.shards { | |||
if shard == nil { // since sa.shards is an array and not a map, some shard slots might be empty. | |||
// order by ID |
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.
No need to order
|
||
for _, id := range keys { | ||
shard, ok := sa.shards[id] | ||
if !ok || shard == 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.
No need to compare to nil
using map instead of growing array as shard id can be 1000+ in some cases
7de4ede
to
2c1e234
Compare
Codecov Report
@@ Coverage Diff @@
## dev #2034 +/- ##
==========================================
- Coverage 59.42% 59.41% -0.01%
==========================================
Files 675 675
Lines 32213 32211 -2
==========================================
- Hits 19142 19139 -3
- Misses 10318 10323 +5
+ Partials 2753 2749 -4
Continue to review full report at Codecov.
|
using map instead of extremely growing array