Faster.Map
9.0.3
dotnet add package Faster.Map --version 9.0.3
NuGet\Install-Package Faster.Map -Version 9.0.3
<PackageReference Include="Faster.Map" Version="9.0.3" />
<PackageVersion Include="Faster.Map" Version="9.0.3" />
<PackageReference Include="Faster.Map" />
paket add Faster.Map --version 9.0.3
#r "nuget: Faster.Map, 9.0.3"
#:package Faster.Map@9.0.3
#addin nuget:?package=Faster.Map&version=9.0.3
#tool nuget:?package=Faster.Map&version=9.0.3
⚑ Faster.Map
A high-performance HashMap library for .NET β€” built for speed, predictable latency, and low memory overhead.
If Dictionary<TKey, TValue> or ConcurrentDictionary<TKey, TValue> is the bottleneck in your hot path, Faster.Map gives you four purpose-built alternatives β€” each tuned for a different access pattern β€” instead of one generic compromise.
⭐ If Faster.Map saves you a few microseconds (or a few million of them), consider starring the repo β€” it genuinely helps the project grow.
Table of Contents
- Why Faster.Map
- Available Implementations
- Choosing the Right Map
- Installation
- Quick Start
- Custom Hashing
- Benchmarks
- What's New
- Supported Platforms
- Used By
- Contributing
- License
Why Faster.Map
Standard Dictionary and ConcurrentDictionary are reliable defaults, but they start to show their limits under high-density tables, heavy concurrent access, or tight allocation budgets β€” exactly the conditions that real-time systems, game engines, caching layers, and high-throughput services live in.
Faster.Map takes a different approach: rather than one general-purpose design, it ships four specialized implementations, so you pick the tradeoff that matches your workload instead of paying for one you don't need.
Key benefits:
- πŸš€ High-performance lookup, insert, update, and remove operations
- πŸͺΆ Low allocation overhead on hot paths
- 🧱 Cache-friendly data layouts
- 🧬 SIMD acceleration where applicable
- πŸ” Pluggable, swappable hash functions
- 🎯 Multiple map strategies for different access patterns
- βœ… Support for modern, actively-maintained .NET targets
Available Implementations
BlitzMap
A flat, open-addressing hashmap tuned for cache locality and strong collision handling. It's the default recommendation β€” fast across the board, with no sharp edges.
Best for: general-purpose high performance Β· low-latency workloads Β· balanced read/write usage Β· "just give me the fast one"
DenseMap
Uses SIMD instructions to compare multiple keys in parallel, cutting lookup latency in dense tables.
Best for: high-density datasets Β· real-time lookups Β· CPU-bound workloads Β· any scenario where SIMD gives a measurable edge
RobinHoodMap
Robin Hood hashing with linear probing keeps probe distances balanced and clustering low.
Best for: read-heavy workloads Β· predictable lookup behavior Β· stable, low-variance latency
CMap
A lock-free concurrent hashmap using open addressing, quadratic probing, and Fibonacci hashing β€” thread-safe performance without a coarse-grained lock.
Best for: multi-threaded applications Β· high-throughput concurrent access Β· minimizing contention
Choosing the Right Map
| Implementation | Best Use Case | Default Choice? |
|---|---|---|
| BlitzMap | General-purpose speed, balanced read/write | βœ… Start here |
| DenseMap | High-density tables, SIMD-accelerated lookups | When density is high |
| RobinHoodMap | Read-heavy, retrieval-focused workloads | When reads dominate |
| CMap | Lock-free multi-threaded access | When thread-safety is required |
Installation
dotnet add package Faster.Map
or via the Package Manager Console:
Install-Package Faster.Map
Quick Start
Using 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);
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);
Custom Hashing
Faster.Map supports pluggable hash functions so you can tune distribution and throughput for your data shape and target hardware:
| Hasher | Notes |
|---|---|
WyHash |
High-speed, general-purpose |
XXHash3 |
Optimized for throughput and low latency |
FastHash |
AES-based (requires hardware AES support) |
CrcHasher |
Non-cryptographic, hardware-accelerated on x86 (SSE4.2) and ARM64 |
DefaultHasher |
Falls back to .NET's built-in GetHashCode() |
var map = new BlitzMap<int, string, XxHash3Hasher.String>();
map.Insert(1, "Value One");
map.Insert(2, "Value Two");
Custom hashing tends to pay off most on large datasets and string-heavy workloads, where distribution quality has an outsized effect on collision rates.
Benchmarks
All figures below come from the benchmark suite in /benchmarks, run with BenchmarkDotNet on .NET 9.
Results at a glance
Mean time per operation across 1,048,576 elements β€” lower is better:
| Implementation | Load Factor 0.1 | Load Factor 0.4 | Load Factor 0.8 |
|---|---|---|---|
| BlitzMap | 337.2 Β΅s | 2,282.0 Β΅s | 6,661.6 Β΅s |
| DenseMap | 496.4 Β΅s | 2,161.9 Β΅s | 4,721.2 Β΅s |
| Dictionary | 432.4 Β΅s | 3,242.6 Β΅s | 11,808.1 Β΅s |
| RobinHoodMap | 450.3 Β΅s | 3,331.5 Β΅s | 17,820.8 Β΅s |
A few honest takeaways, not just the flattering ones:
- At low load factors, the built-in
Dictionaryis already competitive β€” you're mainly buying headroom for later. - Past a 0.4 load factor,
DenseMap's SIMD scanning pulls decisively ahead, running roughly 2.5x faster thanDictionaryat 0.8. RobinHoodMap's linear probing is great at low density but degrades sharply as tables fill up β€” pick it for read-heavy, low-density workloads, not dense ones.BlitzMapstays close to the front across every load factor, which is why it's the default recommendation.
Full benchmark gallery
<details> <summary>Click to expand charts for Get / Insert / Update / Remove / Enumerate / String-key workloads</summary>
Get
Insert
Update
Remove
Enumeration
String keys
String keys, custom hash
Large strings
Large strings, custom hash
</details>
What's New
Recent releases have focused on squeezing more out of BlitzMap's hot path:
- 7–13.7% faster execution across load factors from a fresh round of low-level tuning.
- Signature validation and slot extraction fused into a single branchless operation, cutting redundant ALU work on the lookup path.
- Bucket traversal reordered to trigger out-of-order hardware prefetching, hiding memory latency during hash collisions.
CrcHashergained a hardware-accelerated ARM64 path, with a safe software fallback on unsupported hardware.- Added GC-safety checks around uninitialized memory for reference-type values.
- Reworked probing math and memory marshaling to shrink IL size and help the JIT inline more aggressively.
See the release notes for the full history.
Supported Platforms
| .NET | 7, 8, 9, 10 |
| Architectures | x86, x64, ARM, ARM64 |
Faster.Map targets modern .NET only β€” there's no .NET Framework or
netstandardbuild. If you need those, pin to an older major version on NuGet.
Used By
Faster.Map is already a dependency for other published NuGet packages, including the author's own Faster.Ioc container β€” real production usage, not just benchmarks.
Contributing
Issues, pull requests, and discussions are welcome. If you're proposing a larger change, opening an issue first to talk through the approach is appreciated β€” especially for anything touching the probing or hashing internals.
If Faster.Map is working well for you in production, a comment in Discussions about your use case helps other people evaluate it too.
License
MIT β€” see LICENSE for details.
<div align="center">
If this project helped you ship something faster, ⭐ star it on GitHub β€” it's the easiest way to support the work.
</div>
| 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 | 34 | 7/26/2026 |
| 9.0.2 | 34 | 7/26/2026 |
| 9.0.1 | 39 | 7/26/2026 |
| 9.0.0 | 39 | 7/25/2026 |
| 8.1.1 | 2,351 | 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 |
Major DenseMap performance overhaul achieving C++ SwissTable parity (sub-5ms at 80% load). Optimizations include SIMD fast-path unrolling, entry array mirroring, nuint pointer scaling, and the complete elimination of floating-point and bounds-checking overhead on hot paths.