Skip to content
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

fix: improve nonce performance #162

Merged
merged 4 commits into from
Jun 23, 2022
Merged

fix: improve nonce performance #162

merged 4 commits into from
Jun 23, 2022

Conversation

twoeths
Copy link
Contributor

@twoeths twoeths commented Jun 21, 2022

Motivation

Description

  • New Nonce class containing above data with getUint64(), getBytes() and increase() method
  • New benchmark shows it's 150x faster

@twoeths twoeths changed the title perf: improve nonce feat: improve nonce Jun 21, 2022
@twoeths twoeths changed the title feat: improve nonce feat: improve nonce performance Jun 21, 2022
Introduce Nonce class to maintain both Uint8Array and DataView and uint64 so that we can remove nonceToBytes function
src/@types/nonce.ts Outdated Show resolved Hide resolved
src/handshakes/abstract-handshake.ts Outdated Show resolved Hide resolved
@mpetrunic
Copy link
Member

Great to hear we will optimize noise 👍🏻

@twoeths twoeths marked this pull request as ready for review June 21, 2022 07:32
@twoeths twoeths requested a review from a team as a code owner June 21, 2022 07:32
@twoeths twoeths requested a review from mpetrunic June 21, 2022 07:32
Copy link
Member

@wemeetagain wemeetagain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General structure looks good, good performance boost

src/nonce.ts Outdated Show resolved Hide resolved
src/nonce.ts Show resolved Hide resolved
src/handshakes/abstract-handshake.ts Outdated Show resolved Hide resolved
src/handshakes/abstract-handshake.ts Outdated Show resolved Hide resolved
src/nonce.ts Outdated Show resolved Hide resolved
@mpetrunic mpetrunic changed the title feat: improve nonce performance fix: improve nonce performance Jun 23, 2022
@mpetrunic mpetrunic merged commit 9b04145 into master Jun 23, 2022
@mpetrunic mpetrunic deleted the tuyen/nonce branch June 23, 2022 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants