-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: MongoDB batch call speed optimization #922
Conversation
b6d8ad1
to
2a02fec
Compare
Codecov Report
@@ Coverage Diff @@
## main #922 +/- ##
==========================================
+ Coverage 89.29% 89.35% +0.05%
==========================================
Files 159 159
Lines 14541 14565 +24
==========================================
+ Hits 12985 13014 +29
+ Misses 954 949 -5
Partials 602 602
Continue to review full report at Codecov.
|
2a02fec
to
dc98362
Compare
@@ -70,6 +70,8 @@ func (s *Store) Put(anchorID string, witnesses []*proof.Witness) error { | |||
|
|||
anchorIDEncoded := base64.RawURLEncoding.EncodeToString([]byte(anchorID)) | |||
|
|||
putOptions := &storage.PutOptions{IsNewKey: true} |
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.
I don't think we need this here. There will usually only be 2 or 3 items in the batch.
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.
It'll still be faster and more efficient to use this flag whenever possible. Is there some reason not to?
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.
Actually, it's fine. I didn't notice that a UUID was used as the key.
6a8616e
to
13ab8ec
Compare
Added an optimization for places that call the store.Batch method using keys that are guaranteed to be new. This optimization speeds up those calls significantly when using MongoDB. Signed-off-by: Derek Trider <Derek.Trider@securekey.com>
13ab8ec
to
ba6038d
Compare
@@ -70,6 +70,8 @@ func (s *Store) Put(anchorID string, witnesses []*proof.Witness) error { | |||
|
|||
anchorIDEncoded := base64.RawURLEncoding.EncodeToString([]byte(anchorID)) | |||
|
|||
putOptions := &storage.PutOptions{IsNewKey: true} |
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.
Actually, it's fine. I didn't notice that a UUID was used as the key.
feat: MongoDB batch call speed optimization Signed-off-by: Volodymyr Kubiv <volodymyr.kubiv@euristiq.com>
feat: MongoDB batch call speed optimization Signed-off-by: Volodymyr Kubiv <volodymyr.kubiv@euristiq.com>
Added an optimization for places that call the store.Batch method using keys that are guaranteed to be new. This optimization speeds up those calls significantly when using MongoDB.
Signed-off-by: Derek Trider Derek.Trider@securekey.com