-
Notifications
You must be signed in to change notification settings - Fork 888
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
GODRIVER-2907 Add bulk decryption benchmarks #1806
base: master
Are you sure you want to change the base?
Conversation
API Change ReportNo changes found! |
|
||
b.RunParallel(func(pb *testing.PB) { | ||
for pb.Next() { | ||
decryptDocForBench(b, crypt, encryptedDoc) |
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.
We don't run for the prescribed 1 second because Go benchmarks are designed to automatically determine how long to run a benchmark to achieve stable results. From the docs:
The benchmark function must run the target code b.N times. It is called multiple times with b.N adjusted until the benchmark function lasts long enough to be timed reliably.
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 with minor comments.
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
Co-authored-by: Kevin Albertson <kevin.albertson@10gen.com>
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 good! 👍
GODRIVER-2907
Summary
DRIVERS-2581 makes the
mongocrypt_binary_t
structure public, meaning we can initialize and assign the data and length directly:Same with accessing the bytes:
Initializing directly:
Using setter/accessor:
There does not appear to be extra cost to calling C from Go.
Background & Motivation
Reduce overhead of encryption callbacks by providing bulk-oriented encryption and decryption callbacks