Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
private TypeIdDecoded[] _fastIdTypeIdsDecoded = Array.Empty<TypeIdDecoded>();
private TcKs.TypeId.TypeId[] _tcKsTypeIds = Array.Empty<TcKs.TypeId.TypeId>();
private global::TypeId.TypeId[] _cbuctokTypeIds = Array.Empty<global::TypeId.TypeId>();
#if NET10_0_OR_GREATER
private TypeSafeId.TypeId<Entity>[] _typeSafeIds = Array.Empty<TypeSafeId.TypeId<Entity>>();
#endif

private readonly string _prefixFull;

Expand All @@ -45,9 +43,7 @@
? $"{prefix}_{_suffix}"
: _suffix;

#if NET10_0_OR_GREATER
TypeSafeId.TypeId<Entity>.SetPrefix(prefix);

Check warning on line 46 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdComparison.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdComparison.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 46 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdComparison.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdComparison.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 46 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdComparison.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdComparison.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 46 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdComparison.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdComparison.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'
#endif

_fastIdTypeIds = new[] { TypeId.Parse(typeIdStr), TypeId.Parse(typeIdStr) };
_fastIdTypeIdsDecoded = new[] { TypeId.Parse(typeIdStr).Decode(), TypeId.Parse(typeIdStr).Decode() };
Expand All @@ -59,9 +55,7 @@
}

_cbuctokTypeIds = new[] { global::TypeId.TypeId.Parse(typeIdStr), global::TypeId.TypeId.Parse(typeIdStr) };
#if NET10_0_OR_GREATER
_typeSafeIds = new[] { TypeSafeId.TypeId<Entity>.Parse(typeIdStr), TypeSafeId.TypeId<Entity>.Parse(typeIdStr) };
#endif
}

[Benchmark(Baseline = true)]
Expand All @@ -80,11 +74,9 @@
[BenchmarkCategory("Equality")]
public bool CbuctokEquals() => _cbuctokTypeIds[0] == _cbuctokTypeIds[1];

#if NET10_0_OR_GREATER
[Benchmark]
[BenchmarkCategory("Equality")]
public bool TypeSafeIdEquals() => _typeSafeIds[0] == _typeSafeIds[1];
#endif

[Benchmark(Baseline = true)]
[BenchmarkCategory("HashCode")]
Expand All @@ -102,11 +94,9 @@
[BenchmarkCategory("HashCode")]
public int CbuctokHash() => _cbuctokTypeIds[0].GetHashCode();

#if NET10_0_OR_GREATER
[Benchmark]
[BenchmarkCategory("HashCode")]
public int TypeSafeIdHash() => _typeSafeIds[0].GetHashCode();
#endif

[Benchmark(Baseline = true)]
[BenchmarkCategory("Prefix")]
Expand All @@ -128,11 +118,9 @@
[BenchmarkCategory("Prefix")]
public string CbuctokPrefix() => _cbuctokTypeIds[0].Type;

#if NET10_0_OR_GREATER
[Benchmark]
[BenchmarkCategory("Prefix")]
public string TypeSafeIdPrefix() => TypeSafeId.TypeId<Entity>.Prefix;
#endif

[Benchmark(Baseline = true)]
[BenchmarkCategory("Id")]
Expand All @@ -150,11 +138,9 @@
[BenchmarkCategory("Id")]
public string CbuctokId() => _cbuctokTypeIds[0].Id;

#if NET10_0_OR_GREATER
[Benchmark]
[BenchmarkCategory("Id")]
public Guid TypeSafeIdId() => _typeSafeIds[0].Uuid;
#endif

[Benchmark(Baseline = true)]
[BenchmarkCategory("Suffix")]
Expand All @@ -172,7 +158,6 @@
[BenchmarkCategory("Suffix")]
public string TcKsSuffix() => _tcKsTypeIds[0].Suffix;

#if NET10_0_OR_GREATER
[Benchmark]
[BenchmarkCategory("Suffix")]
public string TypeSafeIdSuffix() => _typeSafeIds[0].GetSuffix();
Expand All @@ -186,5 +171,4 @@
}

public record Entity;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@
{
_prefix = _prefixFull[..PrefixLength];

#if NET10_0_OR_GREATER
TypeSafeId.TypeId<Entity>.SetPrefix(_prefix);

Check warning on line 34 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdGeneration.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdGeneration.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 34 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdGeneration.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdGeneration.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 34 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdGeneration.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdGeneration.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 34 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdGeneration.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdGeneration.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'
#endif
}

[Benchmark(Baseline = true)]
Expand All @@ -60,13 +58,11 @@
return global::TypeId.TypeId.NewTypeId(_prefix);
}

#if NET10_0_OR_GREATER
[Benchmark]
public TypeSafeId.TypeId<Entity> TypeSafeIdBenchmark()
{
return TypeSafeId.TypeId<Entity>.Create();
return TypeSafeId.TypeId.Create<Entity>();
}

public record Entity;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@
var prefix = _prefixFull[..PrefixLength];
_typeIdString = TypeId.FromUuidV7(prefix, _uuidV7).ToString();

#if NET10_0_OR_GREATER
TypeSafeId.TypeId<Entity>.SetPrefix(prefix);

Check warning on line 39 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdParsing.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdParsing.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 39 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdParsing.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdParsing.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 39 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdParsing.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdParsing.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 39 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdParsing.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdParsing.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'
#endif
}

[Benchmark(Baseline = true)]
Expand Down Expand Up @@ -80,7 +78,6 @@
return typeId;
}

#if NET10_0_OR_GREATER
[Benchmark]
public TypeSafeId.TypeId<Entity> TypeSafeIdParse()
{
Expand All @@ -95,5 +92,4 @@
}

public record Entity;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,7 @@
var prefix = _prefixFull[..PrefixLength];
_typeIdString = TypeId.FromUuidV7(prefix, _uuidV7).ToString();

#if NET10_0_OR_GREATER
TypeSafeId.TypeId<Entity>.SetPrefix(prefix);

Check warning on line 38 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdRetrieveFlow.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdRetrieveFlow.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 38 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdRetrieveFlow.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdRetrieveFlow.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 38 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdRetrieveFlow.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdRetrieveFlow.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 38 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdRetrieveFlow.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdRetrieveFlow.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'
#endif
}

[Benchmark(Baseline = true)]
Expand Down Expand Up @@ -69,7 +67,6 @@
return typeId.ToString();
}

#if NET10_0_OR_GREATER
[Benchmark]
public string TypeSafeIdBenchmark()
{
Expand All @@ -78,5 +75,4 @@
}

public record Entity;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
private TypeIdDecoded _fastIdTypeIdDecoded;
private TcKs.TypeId.TypeId _tcKsTypeId;
private global::TypeId.TypeId _cbuctokTypeId;
#if NET10_0_OR_GREATER
private TypeSafeId.TypeId<Entity> _typeSafeIdTypeId;
#endif

public TypeIdString()
{
Expand All @@ -45,11 +43,9 @@
_fastIdTypeId = _fastIdTypeIdDecoded.Encode();
_tcKsTypeId = new TcKs.TypeId.TypeId(prefix, _uuidV7);
_cbuctokTypeId = new global::TypeId.TypeId(prefix, _uuidV7);
#if NET10_0_OR_GREATER
_typeSafeIdTypeId = new TypeSafeId.TypeId<Entity>(_uuidV7);

global::TypeSafeId.TypeId<Entity>.SetPrefix(prefix);

Check warning on line 48 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdString.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdString.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 48 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdString.cs

View workflow job for this annotation

GitHub Actions / build (10)

'TypeId<TypeIdString.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 48 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdString.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdString.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'

Check warning on line 48 in src/FastIDs.TypeId/TypeId.Benchmarks/LibraryComparison/TypeIdString.cs

View workflow job for this annotation

GitHub Actions / build (8)

'TypeId<TypeIdString.Entity>.SetPrefix(string)' is obsolete: 'For testing and benchmarking purposes only.'
#endif
}

[Benchmark(Baseline = true)]
Expand All @@ -76,13 +72,11 @@
return _cbuctokTypeId.ToString();
}

#if NET10_0_OR_GREATER
[Benchmark]
public string TypeSafeId()
{
return _typeSafeIdTypeId.ToString();
}

public record Entity;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
<PackageReference Include="BenchmarkDotNet" Version="0.15.8" />
<PackageReference Include="Evgreg.TypeId" Version="1.0.3" />
<PackageReference Include="TcKs.TypeId" Version="1.3.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net10.0'">
<PackageReference Include="TypeSafeId" Version="1.2.0" />
<PackageReference Include="TypeSafeId" Version="1.3.0" />
</ItemGroup>

<ItemGroup>
Expand Down