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.
- Why Faster.Map
- Available Implementations
- Choosing the Right Map
- Installation
- Quick Start
- Custom Hashing
- Benchmarks
- What's New
- Supported Platforms
- Contributing
- License
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
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."
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.
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.
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.
| Implementation | Best Use Case | Default Choice? |
|---|---|---|
| BlitzMap | General-purpose speed, balanced read/write | Yes, 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 |
dotnet add package Faster.Mapor via the Package Manager Console:
Install-Package Faster.Mapvar 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);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);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.
All figures below come from the benchmark suite in /benchmarks, run with BenchmarkDotNet on .NET 9.
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 us | 2,282.0 us | 6,661.6 us |
| DenseMap | 496.4 us | 2,161.9 us | 4,721.2 us |
| Dictionary | 432.4 us | 3,242.6 us | 11,808.1 us |
| RobinHoodMap | 450.3 us | 3,331.5 us | 17,820.8 us |
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.
Click to expand charts for Get / Insert / Update / Remove / Enumerate / String-key workloads
Recent releases have focused on squeezing more out of BlitzMap's hot path:
- 7 to 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.
| .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.
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.
MIT. See LICENSE for details.
If this project helped you ship something faster, star it on GitHub. It's the easiest way to support the work.








