-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: add noble to benchmark #7
Conversation
test/perf/chacha20poly1305.test.ts
Outdated
beforeEach: () => new Uint8Array(sealed), | ||
fn: (clonedSealed) => { | ||
jsImpl.open(nonce, clonedSealed, ad, clonedSealed.subarray(0, clonedSealed.length - TAG_LENGTH)); | ||
chacha20poly1305Noble(key, nonce, ad).decrypt(clonedSealed); |
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.
chacha20poly1305Noble(key, nonce, ad).decrypt(clonedSealed); | |
chacha20poly1305Noble(key, nonce, ad).decrypt(clonedSealed, clonedSealed.subarray(0, clonedSealed.length - TAG_LENGTH)); |
to reuse buffer?
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 switched to always populate a new result every time so that I can use runsFactor
to benchmark more precisely. All implementations have to populate dst
result so should be no issue comparing them.
// seal | ||
for (const {impl, sealFn} of testCases) { | ||
itBench({ | ||
id: `${impl} seal ${formatBytes(dataLength)}`, |
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.
Format in reverse to it's easier to read,
id: `${impl} seal ${formatBytes(dataLength)}`, | |
id: `${formatBytes(dataLength)} seal ${impl}`, |
Add noble to benchmark tests