Ulid
Ulid copied to clipboard
Comparison with MassTransit.NewId
I benchmarked creating a couple of different unique identifiers as I was also curious:
BenchmarkDotNet v0.13.12, Windows 11 (10.0.22631.3880/23H2/2023Update/SunValley3)
13th Gen Intel Core i7-13700KF, 1 CPU, 24 logical and 16 physical cores
.NET SDK 9.0.100-preview.6.24328.19
[Host] : .NET 9.0.0 (9.0.24.32707), X64 RyuJIT AVX2
DefaultJob : .NET 9.0.0 (9.0.24.32707), X64 RyuJIT AVX2
| Method | Mean | Error | StdDev | Ratio | Gen0 | Allocated | Alloc Ratio |
|------------- |---------:|---------:|---------:|------:|-------:|----------:|------------:|
| Guid_Create | 33.06 ns | 0.041 ns | 0.038 ns | 1.00 | - | - | NA |
| Ulid_Create | 25.91 ns | 0.047 ns | 0.044 ns | 0.78 | - | - | NA |
| NUlid_Create | 77.44 ns | 0.106 ns | 0.094 ns | 2.34 | 0.0066 | 104 B | NA |
| NewId_Create | 28.48 ns | 0.039 ns | 0.032 ns | 0.86 | - | - | NA |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days.