Faster.Map 9.0.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Faster.Map --version 9.0.2
                    
NuGet\Install-Package Faster.Map -Version 9.0.2
                    
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="9.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Faster.Map" Version="9.0.2" />
                    
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 9.0.2
                    
#r "nuget: Faster.Map, 9.0.2"
                    
#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@9.0.2
                    
#: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=9.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Faster.Map&version=9.0.2
                    
Install as a Cake Tool

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

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 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 (3)

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

Package Downloads
Faster.Ioc

Package Description

SynesthesiaDev.Nocturne.Database

🌙 Lightweight and easy-to-use local databse for C#

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
9.0.3 190 7/26/2026
9.0.2 129 7/26/2026
9.0.1 132 7/26/2026
9.0.0 129 7/25/2026
8.1.1 3,370 2/11/2026
8.1.0 856 1/1/2026
8.0.8 446 12/31/2025
8.0.7 550 12/28/2025
8.0.6 493 12/27/2025
8.0.5 475 12/27/2025
8.0.4 499 12/27/2025
8.0.3 628 12/23/2025
8.0.2 608 12/23/2025
8.0.1 642 12/22/2025
8.0.0 641 12/22/2025
7.1.0 678 12/22/2025
7.0.2 625 12/21/2025
7.0.1 2,723 7/27/2025
7.0.0 3,078 4/22/2025
6.1.5 5,800 2/25/2025
Loading failed

### Performance and Architectural Breakthroughs

     * Extreme Throughput Gains: Achieved 7% to 13.7% execution time reduction across all load factors for BlitzMap.
     * Branchless XOR Signature Collapse: Fused signature validation and slot extraction into a single branchless CPU operation, eliminating redundant ALU instructions on the critical lookup path.
     * Out-Of-Order (OOO) Software Pipelining: Reordered bucket traversal instructions to trigger hardware memory prefetching, effectively hiding main memory latency during hash collisions.
     * Cross-Platform Hardware Hashing: Upgraded CrcHasher with comprehensive support for ARM64 (System.Runtime.Intrinsics.Arm) and an optimized software fallback (Knuth's multiplicative hash) for unsupported architectures, retaining zero-cost devirtualization via JIT branch elimination.
     * GC Heap Integrity: Enforced type-safe uninitialized memory allocation checks (RuntimeHelpers.IsReferenceOrContainsReferences) to guarantee garbage collector stability when storing reference types.
     * IL and ALU Optimizations: Replaced quadratic probing multiplication with a mathematical incremental accumulator and consolidated memory marshaling to minimize IL bloat and maximize RyuJIT inlining.