Faster.Map
3.0.3.9
See the version list below for details.
dotnet add package Faster.Map --version 3.0.3.9
NuGet\Install-Package Faster.Map -Version 3.0.3.9
<PackageReference Include="Faster.Map" Version="3.0.3.9" />
<PackageVersion Include="Faster.Map" Version="3.0.3.9" />
<PackageReference Include="Faster.Map" />
paket add Faster.Map --version 3.0.3.9
#r "nuget: Faster.Map, 3.0.3.9"
#:package Faster.Map@3.0.3.9
#addin nuget:?package=Faster.Map&version=3.0.3.9
#tool nuget:?package=Faster.Map&version=3.0.3.9
Faster.Map - A collection of Robin-hood hashmaps (FastMap, DenseMap, MultiMap)
The goal of Faster is to provide the fastest hashmap that integrates into the .net framework.
Faster.Map uses the following:
- Open addressing
- Linear probing
- Upper limit on the probe sequence lenght(psl) which is Log2(size)
- Fibonacci hashing
About
Faster is a small robinhood hashmap with minimal memory overhead and incredibly fast runtime speed. See benchmarks, or try it out yourself. Faster.Map evolved from the fact that C# dictionaries in targetframework 4.0 are terribly slow. So i decided to create my own robinhood hashmap, turns out that this hashmap even performs better than the current dictionary written in .net5.
Get Started
- Install nuget package Faster.Map to your project.
dotnet add package Faster.Map
How to use
Faster.Map provides 3 unique hashmaps:
- FastMap<Tkey, TValue> is a hashmap which has incredible performance, will only work with numerical keys
- DenseMap<Tkey, TValue> is a hashmap which can be used as a replacement to IDicionary.
- MultiMap<Tkey, Tvalue> is a hashmap that contains of key-value pairs, while permitting multiple entries with the same key. All key-value pairs are stored in a linear fashion and won�t require additional Lists e.g Dictionary<int, List<string>>
Examples
Default Example
private FastMap<uint, uint> _map = new FastMap<uint, uint>(16);
_map.Emplace(1, 50);
_map.Remove(1);
_map.Get(1, out var result);
_map.Update(1, 51);
var result = _map[1];
DenseMap Example
private DenseMap<uint, uint> _map = new DenseMap<uint, uint>(16);
_map.Emplace(1, 50);
_map.Remove(1);
_map.Get(1, out var result);
_map.Update(1, 51);
MultiMap Example
private MultiMap<uint, uint> _multimap = new Map<uint, uint>(16);
_multimap.Emplace(1, 50);
_multimap.Remove(24, 24);
_multimap.RemoveAll(1);
_multimap.Update(1, 50);
_multimap.Get(1, out var result);
_multimap.GetAll(1);
Benchmark
Retrieving a million random generated keys
| Method | Mean | Error | StdDev |
|---|---|---|---|
| SlimDictionary | 28.94 ms | 0.740 ms | 2.136 ms |
| Dictionary | 41.60 ms | 1.486 ms | 4.334 ms |
| DenseMap | 22.06 ms | 0.573 ms | 1.644 ms |
| FastMap | 12.74 ms | 0.239 ms | 0.425 ms |
| MultiMap | 23.31 ms | 0.466 ms | 1.344 ms |
Adding a million keys
| Method | Mean | Error | StdDev |
|---|---|---|---|
| DictionarySlim | 21.34 ms | 0.424 ms | 0.904 ms |
| Dictionary | 27.84 ms | 0.556 ms | 1.256 ms |
| FastMap | 14.88 ms | 0.292 ms | 0.437 ms |
| DenseMap | 26.81 ms | 0.689 ms | 2.011 ms |
| MultiMap | 35.51 ms | 1.097 ms | 3.234 ms |
Updating a million keys
| Method | Mean | Error | StdDev | Median |
|---|---|---|---|---|
| DictionarySlim | 30.93 ms | 1.168 ms | 3.407 ms | 29.91 ms |
| Dictionary | 48.30 ms | 2.132 ms | 6.252 ms | 47.03 ms |
| FastMap | 13.62 ms | 0.272 ms | 0.511 ms | 13.60 ms |
| DenseMap | 22.63 ms | 0.487 ms | 1.420 ms | 22.63 ms |
| MultiMap | 28.85 ms | 0.828 ms | 1.728 ms | 28.85 |
Removing a million keys
| Method | Mean | Error | StdDev |
|---|---|---|---|
| SlimDictionary | 5.867 ms | 0.1152 ms | 0.2076 ms |
| Dictionary | 7.636 ms | 0.1703 ms | 0.4994 ms |
| FastMap | 21.410 ms | 0.5362 ms | 1.5297 ms |
| DenseMap | 37.651 ms | 0.9171 ms | 2.6752 ms |
| MultiMap | 47.494 ms | 1.8617 ms | 3.1276 ms |
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 is compatible. net5.0-windows was computed. net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. 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 was computed. 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 was computed. 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 was computed. 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. |
| .NET Framework | net472 is compatible. net48 is compatible. net481 was computed. |
-
.NETFramework 4.7.2
- No dependencies.
-
.NETFramework 4.8
- No dependencies.
-
net5.0
- No dependencies.
-
net6.0
- No dependencies.
NuGet packages (2)
Showing the top 2 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. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 8.1.1 | 582 | 2/11/2026 |
| 8.1.0 | 750 | 1/1/2026 |
| 8.0.8 | 343 | 12/31/2025 |
| 8.0.7 | 450 | 12/28/2025 |
| 8.0.6 | 386 | 12/27/2025 |
| 8.0.5 | 374 | 12/27/2025 |
| 8.0.4 | 397 | 12/27/2025 |
| 8.0.3 | 526 | 12/23/2025 |
| 8.0.2 | 511 | 12/23/2025 |
| 8.0.1 | 544 | 12/22/2025 |
| 8.0.0 | 540 | 12/22/2025 |
| 7.1.0 | 575 | 12/22/2025 |
| 7.0.2 | 534 | 12/21/2025 |
| 7.0.1 | 2,613 | 7/27/2025 |
| 7.0.0 | 2,658 | 4/22/2025 |
| 6.1.5 | 5,632 | 2/25/2025 |
| 6.1.3 | 1,713 | 11/27/2024 |
| 6.1.2 | 377 | 11/16/2024 |
| 3.0.3.9 | 2,513 | 12/9/2022 |
minor changes in multimap