-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Use Ulid instead of Guid for better PERF #16828
base: main
Are you sure you want to change the base?
Conversation
Also, we could introduce |
fc191b3
to
eb16274
Compare
For the sake of the reasoning, we are talking 50ns in the best case. Which is 20 times less than a micro second (not milli, micro). For usages which are not in hot paths. And I can only see drawbacks, like introducing another external dependency, with potentially security implications (is it really unique?), and serialization concerns (will STJ support it like standard dotnet Guids?), and deviating from the standard dotnet libs. Note that the author is very well trusted and we already use ZString or MessagePack. |
Right, but we already used external dependency in many places for example using ZString
Exactly we already used ZString I'm wondering about the STJ serialization, if we intend to use such a thing I might spend some time testing the serialization, but I think it's doable |
This pull request has merge conflicts. Please resolve those before requesting a review. |
This pull request has merge conflicts. Please resolve those before requesting a review. |
The benchmarks show that the
Ulid
is faster https://github.com/Cysharp/UlidFYI .NET 9.0 introduces
Guid.CreateVersion7()
but according to my findingsUlid
is still the fastest