Faster.Map 8.1.1

dotnet add package Faster.Map --version 8.1.1
                    
NuGet\Install-Package Faster.Map -Version 8.1.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="Faster.Map" Version="8.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Faster.Map" Version="8.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Faster.Map" />
                    
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 Faster.Map --version 8.1.1
                    
#r "nuget: Faster.Map, 8.1.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 Faster.Map@8.1.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=Faster.Map&version=8.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Faster.Map&version=8.1.1
                    
Install as a Cake Tool

โšก Faster.Map โ€” High-Performance HashMap for .NET

Faster.Map is a blazing-fast, memory-efficient HashMap library for .NET. Itโ€™s built to outperform Dictionary<TKey,TValue> and ConcurrentDictionary<TKey,TValue> by providing SIMD acceleration, lock-free concurrency, and custom hashing algorithms.

Designed for real-time systems, game engines, caching layers, and data-intensive applications, Faster.Map delivers exceptional speed, scalability, and predictable performance across varying load factors.


๐Ÿš€ Why Faster.Map?

The goal of Faster.Map is to create a more efficient and performant alternative to .NETโ€™s built-in Dictionary and ConcurrentDictionary. While those are reliable, they can struggle under high-density workloads, frequent concurrent operations, or tight memory constraints.

Faster.Map solves those problems by providing specialized implementations optimized for different workloads.


๐Ÿงฉ Available Implementations

DenseMap โ€“ SIMD-Accelerated Lookups

Harnesses SIMD (Single Instruction, Multiple Data) instructions for parallel key comparisons, drastically reducing lookup latency. โœ… Best for high-density datasets, real-time lookups, and CPU-bound workloads.


RobinHoodMap โ€“ Linear Probing Strategy

Uses Robin Hood hashing to evenly distribute probe distances, minimizing clustering. โœ… Ideal for retrieval-heavy applications and balanced workloads.


CMap โ€“ Lock-Free Concurrent HashMap

A thread-safe, lock-free, open-addressing HashMap using quadratic probing and Fibonacci hashing. โœ… Perfect for multi-threaded environments requiring high throughput and minimal contention.


BlitzMap โ€“ Flat Open-Addressing HashMap

Employs a linked bucket approach similar to separate chaining but optimized for cache locality and collision resilience. โœ… The fastest all-round implementation, ideal for general-purpose and low-latency workloads.


๐Ÿ“œ Table of Contents


๐Ÿ“ฆ Installation

Install Faster.Map via NuGet:

Install-Package Faster.Map

Supports .NET 6+, .NET 8, .NET Framework 4.8, and cross-platform (x86, x64, ARM, ARM64).


๐Ÿง  Basic Usage Examples

Example: Using BlitzMap

var map = new BlitzMap<int, string>();
map.Insert(1, "Value One");
map.Insert(2, "Value Two");
map.InsertUnique(3, "Value Four");
map.InsertOrUpdate(2, "Updated");

if (map.Get(1, out var value))
    Console.WriteLine($"Key 1 has value: {value}");

map.Update(1, "Updated value one");
map.Remove(1);

var n = new BlitzMap<uint, uint>();
n.Insert(1,1);
map.Copy(n);

Example: Using DenseMap

var map = new DenseMap<int, string>();
map.Emplace(1, "Value One");
map.Emplace(2, "Value Two");

if (map.Get(1, out var value))
    Console.WriteLine($"Key 1 has value: {value}");

map.Remove(1);

๐Ÿงฉ Advanced Usage

๐Ÿ”‘ Custom Hashing Algorithms

Faster.Map supports pluggable hash functions for maximum performance:

  • WyHash โ€“ High-speed general purpose hashing.
  • XXHash3 โ€“ Optimized for throughput and low latency.
  • FastHash โ€“ AES-based hashing (requires X86Aes support).
  • CrcHasher โ€“ Non-cryptographic hash with good distribution (requires Sse42)
  • DefaultHasher โ€“ .NET's built-in GetHashCode().

Example:

var map = new BlitzMap<int, string, XxHash3Hasher.String>();
map.Insert(1, "Value One");
map.Insert(2, "Value Two");

All hashers are in the Faster.Map.Hasher namespace. ๐Ÿ‘‰ Custom hashing significantly improves lookup speed and reduces collisions in large datasets.


๐Ÿงฑ Tested on Platforms

  • x86
  • x64
  • ARM
  • ARM64

๐Ÿงฎ Selecting the Right HashMap

Implementation Best Use Case
DenseMap High-density datasets, SIMD-accelerated lookups
RobinHoodMap Retrieval-heavy workloads, stable latency
CMap Lock-free multi-threaded performance
BlitzMap General-purpose speed and consistent performance

โœ… Recommendation:
Use BlitzMap for balanced performance, DenseMap for dense tables, RobinHoodMap for read-heavy workloads, and CMap for multi-threaded use.


๐Ÿงช Benchmarks

(All benchmarks executed with BenchmarkDotNet v0.13.12 on .NET 9, Intel i5-12500H)

These benchmarks demonstrate how Faster.Map compares to Dictionary<TKey,TValue> across GET, INSERT, UPDATE, REMOVE, and ENUMERATE workloads at various load factors.


๐Ÿ“Š Get Benchmark

Get Benchmark by Load Factor

๐Ÿ† BlitzMap is the most consistent performer across all load factors.
๐Ÿš€ DenseMap excels at high densities via SIMD acceleration.
โš ๏ธ RobinhoodMap collapses after 0.5 load factor.
๐Ÿ”ป Dictionary suffers from excessive collisions.

Conclusion:
For balanced workloads, choose BlitzMap; for dense workloads, choose DenseMap.


๐Ÿ“Š Insert Benchmark

Insert Benchmark by Load Factor

๐Ÿ† BlitzMap remains the fastest overall.
๐Ÿš€ DenseMap shines at high load factors.
โš ๏ธ RobinHoodMap degrades above 0.5.
๐Ÿ”ป Dictionary performs poorly under heavy loads.

Conclusion:
BlitzMap is the best general performer; DenseMap dominates full tables.


๐Ÿ“Š Update Benchmark

Update Benchmark by Load Factor

๐Ÿ† BlitzMap leads beyond 0.5 load factor.
โšก RobinhoodMap dominates at lower densities.
๐Ÿš€ DenseMap struggles at low densities due to SIMD overhead.

Conclusion:
Use RobinhoodMap for sparse data; BlitzMap for dense updates.


๐Ÿ“Š Remove Benchmark

Remove Benchmark by Load Factor

๐Ÿ† RobinhoodMap offers best scaling for removals.
๐Ÿš€ Dictionary wins at low densities.
โš ๏ธ DenseMap performs worst at high load factors.

Conclusion:
Choose RobinhoodMap for removal-heavy workloads.


๐Ÿ“Š Enumerable Benchmark

Enumerable Benchmark by Load Factor

๐Ÿ† BlitzMap is fastest across all load factors.
โšก RobinhoodMap and DenseMap degrade significantly at high densities.

Conclusion:
For frequent iteration, BlitzMap is unmatched.


๐Ÿ“Š Get String Benchmark

Get String Benchmark by Load Factor

๐Ÿ† BlitzMap scales best; Dictionary wins at low density.
๐Ÿš€ DenseMap struggles with string hashing.

Conclusion:
For large string keys, use BlitzMap.


๐Ÿ“Š Get String Custom Hash Benchmark

Get String Custom Hash Benchmark by Load Factor

๐Ÿ† BlitzMap + FastHash is fastest overall.
๐Ÿง  WyHash and XXHash3 perform better than defaults.

Conclusion:
Use FastHash for best string lookup performance.


๐Ÿ“Š Get Large String Benchmark

Get Large String Benchmark by Load Factor

๐Ÿ† Dictionary dominates at low load factors.
๐Ÿš€ BlitzMap maintains performance at high densities.
โš ๏ธ DenseMap degrades quickly.

Conclusion:
Dictionary wins for small tables; BlitzMap wins for scalability.


๐Ÿ“Š Large String Custom Hash Benchmark

Large String Custom Hash Benchmark by Load Factor

๐Ÿ† BlitzMapFastHash is the clear winner.
WyHash and XXHash3 are strong alternatives.
Dictionary performs worst at scale.

Conclusion:
For high-performance string key lookups, BlitzMapFastHash delivers the best scalability and speed.


๐Ÿ” SEO Keywords

hashmap, fast dictionary, csharp, dotnet, lock-free, simd, memory-efficient, high-performance, collections, data-structures, xxhash, wyhash, fast-hashmap, performance-benchmark

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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 is compatible.  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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Faster.Map:

Package Downloads
Faster.Ioc

Package Description

UPSRestApi

UpsRestApi library for .Net used to access UPS API Catalog to browse products and view documentation.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
8.1.1 35 2/11/2026
8.1.0 375 1/1/2026
8.0.8 247 12/31/2025
8.0.7 348 12/28/2025
8.0.6 297 12/27/2025
8.0.5 286 12/27/2025
8.0.4 302 12/27/2025
8.0.3 435 12/23/2025
8.0.2 420 12/23/2025
8.0.1 450 12/22/2025
8.0.0 445 12/22/2025
7.1.0 463 12/22/2025
7.0.2 439 12/21/2025
7.0.1 2,517 7/27/2025
7.0.0 2,238 4/22/2025
6.1.5 4,828 2/25/2025
6.1.3 1,617 11/27/2024
6.1.2 355 11/16/2024
6.1.1 1,120 10/31/2024
Loading failed

minor improvements to blitzmap