-
Notifications
You must be signed in to change notification settings - Fork 167
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
optimize parsing ulid #116
base: main
Are you sure you want to change the base?
Conversation
I've misunderstood something here, let me revert. |
This code relies on the behavior of sign extension. Therefore, |
Please look at this PR from the perspective of a future maintainer. Help them understand how this works, and why it's better than the previous approach, with documentation. |
I updated the description of the pull request, and comments in the source. |
@peterbourgon I would even be happy to have better performance in my downstream applications, even if I do not understand all the bit juggling. Just saying. |
Of course, but when this code is merged, it becomes my responsibility, so I need to understand it, even if you don't :) |
@peterbourgon I see. Thank you for this very nice package. I hope you will find the time to understand what he did soon. |
In this pull request, we have improved the performance of Parse. Instead of directly converting ULID to a [16]byte, it is converted through multiple uint64 variables. This change allows us to reduce the number of bit operations, leading to faster performance.
The result of benchmark is here: