Releases: CombinationAB/Combination.StringPools
Releases · CombinationAB/Combination.StringPools
2.0.0
2.0.0-rc1
1.3.0
Summary
Performance optimizations, net8 upgrade and a bug fix to adding strings to a pool from multiple threads at the same time,
What's Changed
- [GP-2870] Update to .Net8 by @KimPlaybit in #35
- Fixed possible threading issue by @rickardp in #31
- Removed .NET 7 package, fixed .NET 8 build by @rickardp in #34
- Improved performance by using a circular dynamically sized dup table by @rickardp in #32
New Contributors
- @KimPlaybit made their first contribution in #35
Full Changelog: 1.2.0...1.3.0
Changed to a more efficient hash algorithm
Based on benchmarking, using XXHash3 instead of Fowler-Noll as a hash algorithm.
Fowler–Noll–Vo 1a
Method | String | Mean | Error | StdDev |
---|---|---|---|---|
Hash | Some ASCII string | 21.12 ns | 0.293 ns | 0.245 ns |
Hash | Some ünicöde string | 30.84 ns | 0.278 ns | 0.232 ns |
XxHash64
Method | String | Mean | Error | StdDev |
---|---|---|---|---|
Hash | Some ASCII string | 14.59 ns | 0.127 ns | 0.112 ns |
Hash | Some ünicöde string | 16.09 ns | 0.104 ns | 0.086 ns |
XxHash3
Method | String | Mean | Error | StdDev |
---|---|---|---|---|
Hash | Some ASCII string | 12.82 ns | 0.096 ns | 0.085 ns |
Hash | Some ünicöde string | 12.96 ns | 0.247 ns | 0.231 ns |
Avoid IndexOutOfRangeException
Avoiding a negative index by making sure long
doesn't get downcast to int
during multiplication and assignment.
PooledUtf8String.Empty == default(PooledUtf8String)
Using the default keyword with PooledUtf8String now returns an object that is the same as PooledUtf8String.Empty.
Implement IComparable
1.1.2 Implement IComparable
Zero alloc UTF-8 insertion
Allows the insertion of raw UTF-8 sequences into the string pool, without round tripping to .NET strings. Also allows arbitrary sequences of char.
Improved GetHashCode performance
1.0.2 Use bytes for hash code generation instead of creating string and cal…
Performance optimizations
Avoid unnecessary memory allocations on Add