-
Notifications
You must be signed in to change notification settings - Fork 151
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
Nuid #360
Nuid #360
Conversation
- Bump global.json to 3.1 - Move benchmark projects to dedicated directory
We dove right in making comments before saying thank you for the PR. Just wanted to leave a note saying that this is really good and highly appreciated! |
Thank you, much appreciated. Comments are fair, so it's all good. :) |
Sorry, added another commit. Changed most uses of signed integers to unsigned ones. I think this actually improves the code since non-negative integers are expected in multiple places. Also removed a suspicious cast to Int32. |
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. Thanks!
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. Thanks!
For posterity, here are the benchmarks on my workstation:
|
Notable changes:
Let me know if you have questions/change requests
Edit:
Haven't changed the token generation yet (nats-io/nats.net#351 (comment)), would do so in a seperate PR
Issue for reference: #351
Benchmark Results
NextNuid is in this PR, NUIDNext is the existing (unused) NUID implementation, OldNewInbox is the currently used implementation (https://github.com/jasper-d/nats.net/blob/bd2abf39df3b7c7c06d12ec9a0069e066650f504/src/Benchmarks/MicroBenchmarks/Program.cs).
Windows
Linux
nuid.go for reference (the figures differ quite a lot between runs, but these are the lowest numbers I got):