You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Updated README.md with new benchmark results and library versions, including NUlid (1.7.2 to 1.7.3) and BenchmarkDotNet (0.14.0 to 0.15.2).
- Added a new benchmark method for `GuidV7`
- Modified ByteAether.Benchmarks.csproj and ByteAether.Ulid.Tests.csproj to update package versions and add conditional references.
- Updated ByteAether.Ulid.csproj to newer versions of System.Memory (4.6.3) and System.Runtime.CompilerServices.Unsafe (6.1.2).
Copy file name to clipboardExpand all lines: README.md
+62-60Lines changed: 62 additions & 60 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -339,87 +339,89 @@ var deserializedObject = JsonConvert.DeserializeObject<MyObject>(json, settings)
339
339
## Benchmarking
340
340
To ensure the performance and efficiency of this ULID implementation, benchmarking was conducted using [BenchmarkDotNet](https://github.com/dotnet/BenchmarkDotNet).
341
341
342
-
For comparison, [NetUlid](https://github.com/ultimicro/netulid) 2.1.0, [Ulid](https://github.com/Cysharp/Ulid) 1.3.4 and [NUlid](https://github.com/RobThree/NUlid) 1.7.2 implementations were benchmarked alongside.
342
+
For comparison, [NetUlid](https://github.com/ultimicro/netulid) 2.1.0, [Ulid](https://github.com/Cysharp/Ulid) 1.3.4 and [NUlid](https://github.com/RobThree/NUlid) 1.7.3 implementations were benchmarked alongside ByteAether.Ulid v1.1.1.
343
343
344
344
Benchmark scenarios also include comparisons against `Guid`, where functionality overlaps, such as creation, parsing, and byte conversions.
345
345
346
346
The following benchmarks were performed:
347
347
```
348
-
BenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5247/22H2/2022Update)
348
+
BenchmarkDotNet v0.14.0, Windows 10 (10.0.19045.5965/22H2/2022Update)
All competitive libraries deviate from the official ULID specification in various ways or have other drawbacks:
418
420
1.`NetUlid`: Can only maintain monotonicity in the scope of a single thread.
419
421
2.`NUlid`: Requires special configuration to enable monotonic generation. You have to write your own wrapper with state.
420
-
3.`Ulid`: Does not implement monotonicity.
422
+
3.`Ulid` & `GuidV7`: Does not implement monotonicity.
421
423
4.`Ulid`: This library uses a cryptographically non-secure `XOR-Shift` random value generation. Only the initial seed is generated by a cryptographically secure generator.
422
-
5.`Guid`: [The Guid documentation explicitly states](https://learn.microsoft.com/en-us/dotnet/api/system.guid.newguid?view=net-9.0#remarks) that its random component may not be generated using a cryptographically secure random number generator (RNG), and that `Guid` values should not be used for cryptographic purposes.
424
+
5.`Guid` & `GuidV7`: [The Guid documentation explicitly states](https://learn.microsoft.com/en-us/dotnet/api/system.guid.newguid?view=net-9.0#remarks) that its random component may not be generated using a cryptographically secure random number generator (RNG), and that `Guid` values should not be used for cryptographic purposes.
423
425
424
426
Both `NetUlid` and `NUlid`, which do provide monotonicity, may randomly throw `OverflowException`, when stars align against you. (Random-part overflow)
0 commit comments