Faster.Map
9.0.1
See the version list below for details.
dotnet add package Faster.Map --version 9.0.1
NuGet\Install-Package Faster.Map -Version 9.0.1
<PackageReference Include="Faster.Map" Version="9.0.1" />
<PackageVersion Include="Faster.Map" Version="9.0.1" />
<PackageReference Include="Faster.Map" />
paket add Faster.Map --version 9.0.1
#r "nuget: Faster.Map, 9.0.1"
#:package Faster.Map@9.0.1
#addin nuget:?package=Faster.Map&version=9.0.1
#tool nuget:?package=Faster.Map&version=9.0.1
Faster.Map — High-Performance HashMap for .NET
Faster.Map is a high-performance HashMap library for .NET built for speed, predictable latency, and efficient memory usage. It provides specialized map implementations for different workloads, including dense datasets, read-heavy access patterns, lock-free concurrent scenarios, and cache-friendly general-purpose use.
If you need a faster alternative to Dictionary<TKey, TValue> or ConcurrentDictionary<TKey, TValue> for performance-sensitive applications, Faster.Map gives you focused implementations designed to reduce overhead and improve throughput.
Why Faster.Map
Faster.Map is designed for applications where standard dictionary performance is not enough.
It is a strong fit for:
- Real-time systems
- Game engines
- Caching layers
- High-throughput services
- Data-intensive applications
- Low-latency workloads
- Concurrent and multi-core environments
Instead of relying on one general-purpose design, Faster.Map provides multiple implementations so you can choose the right tradeoff for your workload.
Key Benefits
- High-performance lookup, insert, update, and remove operations
- Low allocation overhead on hot paths
- Cache-friendly data layouts
- SIMD acceleration where applicable
- Custom hashing support
- Multiple map strategies for different access patterns
- Support for modern .NET targets
Available Implementations
DenseMap
DenseMap uses SIMD acceleration to compare keys in parallel and reduce lookup latency in dense tables.
Best for:
- High-density datasets
- Real-time lookups
- CPU-bound workloads
- Scenarios where SIMD provides a measurable advantage
RobinHoodMap
RobinHoodMap uses Robin Hood hashing with linear probing to reduce clustering and keep probe distances balanced.
Best for:
- Read-heavy workloads
- Predictable lookup behavior
- Stable latency
- Balanced access patterns
CMap
CMap is a lock-free concurrent HashMap using open addressing, quadratic probing, and Fibonacci hashing.
Best for:
- Multi-threaded applications
- High-throughput concurrent access
- Minimal contention
- Thread-safe performance without coarse locking
BlitzMap
BlitzMap is a flat open-addressing HashMap optimized for cache locality and strong collision handling.
Best for:
- General-purpose high performance
- Low-latency workloads
- Balanced read/write usage
- Fast default performance across many scenarios
Installation
Install Faster.Map from NuGet:
Install-Package Faster.Map
Quick Start
BlitzMap
var map = new BlitzMap<int, string>();
map.Insert(1, "Value One");
map.Insert(2, "Value Two");
map.InsertUnique(3, "Value Three");
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);
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);
Custom Hashing
Faster.Map supports pluggable hash functions so you can optimize for your data and platform.
Available hashers include:
- WyHash
- XXHash3
- FastHash
- CrcHasher
- DefaultHasher
Example:
var map = new BlitzMap<int, string, XxHash3Hasher.String>();
map.Insert(1, "Value One");
map.Insert(2, "Value Two");
Custom hashing can improve distribution, reduce collisions, and increase lookup performance, especially for large datasets and string-heavy workloads.
Choosing the Right Map
| Implementation | Best Use Case |
|---|---|
| DenseMap | High-density datasets and SIMD-accelerated lookups |
| RobinHoodMap | Read-heavy workloads and stable probe behavior |
| CMap | Concurrent workloads requiring lock-free access |
| BlitzMap | General-purpose high performance and low latency |
Recommendation: use BlitzMap as the default choice, DenseMap when table density is high, RobinHoodMap for retrieval-heavy workloads, and CMap when thread-safe concurrent access is the priority.
Supported Platforms
Faster.Map supports:
- .NET 7
- .NET 8
- .NET 9
- .NET 10
- x86
- x64
- ARM
- ARM64
Benchmarks
Benchmark results are included in the repository to compare Faster.Map with Dictionary<TKey, TValue> across common workloads such as get, insert, update, remove, and enumeration.
The benchmark suite includes:
- Integer key workloads
- String key workloads
- Custom hash function comparisons
- Multiple load factors
- Dense and large-string scenarios
If your project depends on dictionary performance, the benchmark charts help you choose the right implementation for your workload.
Design Goals
Faster.Map is built around a few core goals:
- Make hot-path operations fast
- Keep memory usage efficient
- Preserve predictable performance under load
- Support specialized hashing strategies
- Offer multiple implementations instead of one compromise design
- Stay practical for real .NET applications
Repository
- GitHub: https://github.com/Wsm2110/Faster.Map
- NuGet package: Faster.Map
Keywords
HashMap, hash table, .NET, C#, high-performance dictionary, memory-efficient collections, SIMD, lock-free concurrent map, fast lookup, low latency, cache-friendly data structures, custom hashing, Dictionary replacement
| 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.10)
-
net7.0
- System.IO.Hashing (>= 8.0.0)
-
net8.0
- System.IO.Hashing (>= 8.0.0)
-
net9.0
- System.IO.Hashing (>= 9.0.18)
NuGet packages (3)
Showing the top 3 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. |
|
|
SynesthesiaDev.Nocturne.Database
🌙 Lightweight and easy-to-use local databse for C# |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 9.0.3 | 44 | 7/26/2026 |
| 9.0.2 | 43 | 7/26/2026 |
| 9.0.1 | 48 | 7/26/2026 |
| 9.0.0 | 48 | 7/25/2026 |
| 8.1.1 | 2,392 | 2/11/2026 |
| 8.1.0 | 842 | 1/1/2026 |
| 8.0.8 | 437 | 12/31/2025 |
| 8.0.7 | 541 | 12/28/2025 |
| 8.0.6 | 480 | 12/27/2025 |
| 8.0.5 | 463 | 12/27/2025 |
| 8.0.4 | 487 | 12/27/2025 |
| 8.0.3 | 613 | 12/23/2025 |
| 8.0.2 | 596 | 12/23/2025 |
| 8.0.1 | 632 | 12/22/2025 |
| 8.0.0 | 631 | 12/22/2025 |
| 7.1.0 | 669 | 12/22/2025 |
| 7.0.2 | 614 | 12/21/2025 |
| 7.0.1 | 2,713 | 7/27/2025 |
| 7.0.0 | 2,994 | 4/22/2025 |
| 6.1.5 | 5,788 | 2/25/2025 |
Massive performance rewrite targeting extreme throughput and L1 cache maximization.
Key architectural optimizations in this release:
- Asymmetric Metadata Sign-Bit Layout: Redefined state values (Empty=-128, Tombstone=0, Live=1..127) to completely eliminate vector equality checks (vcmpeq) from the hot path. SIMD loops now terminate via a single, branchless sign-bit extraction (vpmovmskb).
- Hardware Prefetcher Activation: Replaced triangular probing with strict linear group probing (+32 bytes), allowing the CPU hardware spatial prefetcher to load collision chains into the L1 cache ahead of execution.
- L1 Cache Spatial Locality: Restored Array of Structs (AoS) memory layout to guarantee that Keys and Values are fetched into the CPU cache together on the 95% happy path.
- Branchless IL Execution: Eliminated pipeline-stalling conditional branches in H2 hash clamping and array bounds mirroring using bitwise underflow and sign-extension mathematics.
- Critical Bug Fix: Patched a fatal SIMD out-of-bounds memory over-read during Resize() and Rebuild() by correctly aligning vector padding to the AVX2 32-byte group width.
Benchmarks show up to a 31% throughput increase at high load factors (0.8) and significant latency reductions across all densities.