Faster.Map
8.1.1
dotnet add package Faster.Map --version 8.1.1
NuGet\Install-Package Faster.Map -Version 8.1.1
<PackageReference Include="Faster.Map" Version="8.1.1" />
<PackageVersion Include="Faster.Map" Version="8.1.1" />
<PackageReference Include="Faster.Map" />
paket add Faster.Map --version 8.1.1
#r "nuget: Faster.Map, 8.1.1"
#:package Faster.Map@8.1.1
#addin nuget:?package=Faster.Map&version=8.1.1
#tool nuget:?package=Faster.Map&version=8.1.1
โก 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
- Available Implementations
- Installation
- Basic Usage
- Advanced Usage
- Selecting the Right Hashmap
- Tested Platforms
- Benchmarks
๐ฆ 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
๐ 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
๐ 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
๐ 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
๐ 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
๐ 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
๐ 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
๐ BlitzMap + FastHash is fastest overall.
๐ง WyHash and XXHash3 perform better than defaults.
Conclusion:
Use FastHash for best string lookup performance.
๐ Get Large String Benchmark
๐ 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
๐ 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 | Versions 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. |
-
net10.0
- System.IO.Hashing (>= 10.0.3)
-
net7.0
- System.IO.Hashing (>= 8.0.0)
-
net8.0
- System.IO.Hashing (>= 8.0.0)
-
net9.0
- System.IO.Hashing (>= 9.0.13)
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 |
minor improvements to blitzmap