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

Switch to AtomicU64 counter #32

Closed
wants to merge 1 commit into from

Conversation

hlb8122
Copy link

@hlb8122 hlb8122 commented Nov 14, 2019

Justification

  • AtomicU64 has better performance than Arc<Mutex<u64>>.
  • The fetch_add fits nicely here.
  • last_nonce doesn't really make sense here, because you get 0 just after initializing the client (before you have used any nonce). next_nonce however breaks the API.

Notes

@hlb8122 hlb8122 closed this Nov 14, 2019
@hlb8122 hlb8122 deleted the switch-to-atomic-counter branch November 14, 2019 14:30
@apoelstra
Copy link
Owner

Curious about the motivation for closing

@hlb8122
Copy link
Author

hlb8122 commented Jan 2, 2020

@apoelstra No idea, I forgot I had this PR when I deleted the branch - perhaps that did it. I can restore it if you'd like.

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.

None yet

3 participants