Faster.Map 9.0.1

There is a newer version of this package available.
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
                    
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.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Faster.Map" Version="9.0.1" />
                    
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.1
                    
#r "nuget: Faster.Map, 9.0.1"
                    
#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.1
                    
#: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.1
                    
Install as a Cake Addin
#tool nuget:?package=Faster.Map&version=9.0.1
                    
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

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.