Celerity.Collections 1.0.1

dotnet add package Celerity.Collections --version 1.0.1
                    
NuGet\Install-Package Celerity.Collections -Version 1.0.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Celerity.Collections" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Celerity.Collections" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Celerity.Collections" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Celerity.Collections --version 1.0.1
                    
#r "nuget: Celerity.Collections, 1.0.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Celerity.Collections@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Celerity.Collections&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Celerity.Collections&version=1.0.1
                    
Install as a Cake Tool

Celerity

NuGet version (Celerity.Collections) NuGet version (Celerity.Collections)

Celerity is a .NET library that provides specialized high-performance collections optimized for specific use cases. It includes data structures designed for better speed or memory efficiency compared to standard .NET collections. The package supports configurable load factors, multiple built-in hash functions, and allows users to define custom hash functions for fine-tuned performance.

Benchmarks

CelerityDictionary

CelerityDictionary allows you to bring your own custom key hasher to best suit your needs. Below you have a benchmark between a standard .NET Dictionary<int, int> and a CelerityDictionary<int, int, Int32WangNaiveHasher> using a random key distribution.

Method ItemCount Mean Error StdDev Allocated
Dictionary_Insert 1000 13,768.8 ns 104.56 ns 92.69 ns 73168 B
CelerityDictionary_Insert 1000 8,540.0 ns 82.35 ns 73.00 ns 33072 B
Dictionary_Lookup 1000 2,842.1 ns 7.55 ns 7.06 ns -
CelerityDictionary_Lookup 1000 1,660.1 ns 14.09 ns 12.49 ns -
Dictionary_Remove 1000 1,358.9 ns 13.87 ns 12.97 ns -
CelerityDictionary_Remove 1000 870.6 ns 2.69 ns 2.38 ns -
Dictionary_Insert 100000 2,466,978.2 ns 49,091.20 ns 50,413.05 ns 6037813 B
CelerityDictionary_Insert 100000 2,860,774.8 ns 50,391.63 ns 47,136.36 ns 4195120 B
Dictionary_Lookup 100000 1,021,650.8 ns 11,702.28 ns 10,373.77 ns 1 B
CelerityDictionary_Lookup 100000 422,466.0 ns 4,472.81 ns 3,965.03 ns -
Dictionary_Remove 100000 149,102.9 ns 926.90 ns 867.02 ns -
CelerityDictionary_Remove 100000 129,491.3 ns 2,092.50 ns 1,854.94 ns -

IHashProvider

You can implement your own custom hash provider by implementing IHashProvider<T>.

public interface IHashProvider<T>
{
    int Hash(T key);
}
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 277 3/23/2025
0.0.0-beta.7 67 2/23/2025