Faster.Map
4.0.6
See the version list below for details.
dotnet add package Faster.Map --version 4.0.6
NuGet\Install-Package Faster.Map -Version 4.0.6
<PackageReference Include="Faster.Map" Version="4.0.6" />
<PackageVersion Include="Faster.Map" Version="4.0.6" />
<PackageReference Include="Faster.Map" />
paket add Faster.Map --version 4.0.6
#r "nuget: Faster.Map, 4.0.6"
#:package Faster.Map@4.0.6
#addin nuget:?package=Faster.Map&version=4.0.6
#tool nuget:?package=Faster.Map&version=4.0.6
Faster.Map - A collection of hashmaps (FastMap, DenseMapSIMD and DenseMap)
The goal of Faster is to provide a collection of incredible fast hashmaps that integrates into the .net framework.
About
Faster.Map is a collection of hashmaps with minimal memory overhead and incredibly fast runtime speed. See benchmarks, or try it out yourself. Faster 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 .net7.
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. Keys need to be unique. Won`t handle hashcollisions
DenseMap<Tkey, TValue> is a hashmap which can be used as a replacement to IDicionary. Default loadfactor is 0.5
DenseMapSIMD<Tkey, TValue> is a next level hashmap using simd intructions. The default loadfactor is 0.9. This allows us to store 15% more entries than a dictionary while maintaining incredible speed. This hashmap is fast and i mean mindblowing fast. DenseMapSIMD wont cache hashcodes, using types like strings actually need a wrapper that caches the hashcode. Hence using a slow hash fuction will result in a slow hashmap.
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);
DenseMapSIMD
private DenseMapSIMD<uint, uint> _map = new DenseMapSIMD<uint, uint>(16);
_map.Emplace(1, 50);
_map.Remove(1);
_map.Get(1, out var result);
_map.Update(1, 51);
Benchmark
Retrieving a million random generated keys
Method | Mean | Error | StdDev |
---|---|---|---|
SlimDictionary | 14.041 ms | 0.1952 ms | 0.1731 ms |
Dictionary | 16.712 ms | 0.3339 ms | 0.8000 ms |
DenseMapSIMD | 7.604 ms | 0.1050 ms | 0.0982 ms |
DenseMap | 13.126 ms | 0.1976 ms | 0.1848 ms |
FastMap | 9.577 ms | 0.1660 ms | 0.1386 ms |
Adding a million keys
Method | Mean | Error | StdDev |
---|---|---|---|
DictionarySlim | 25.09 ms | 0.313 ms | 0.292 ms |
Dictionary | 17.43 ms | 0.451 ms | 1.294 ms |
DenseMapSIMD | 12.23 ms | 0.443 ms | 1.286 ms |
FastMap | 29.38 ms | 0.603 ms | 1.298 ms |
DenseMap | 34.86 ms | 0.768 ms | 0.914 ms |
Updating a million keys
Method | Mean | Error | StdDev |
---|---|---|---|
SlimDictionary | 14.624 ms | 0.2158 ms | 0.1913 ms |
Dictionary | 19.102 ms | 0.3739 ms | 0.7023 ms |
DenseMapSIMD | 8.053 ms | 0.1523 ms | 0.1425 ms |
FastMap | 9.953 ms | 0.1157 ms | 0.1082 ms |
DenseMap | 13.793 ms | 0.1122 ms | 0.0995 ms |
Removing a million keys
Method | Mean | Error | StdDev |
---|---|---|---|
SlimDictionary | 16.66 ms | 0.326 ms | 0.545 ms |
Dictionary | 23.33 ms | 0.373 ms | 0.331 ms |
FastMap | 17.53 ms | 0.341 ms | 0.407 ms |
DenseMapSIMD | 14.71 ms | 0.288 ms | 0.332 ms |
DenseMap | 25.16 ms | 0.395 ms | 0.350 ms |
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 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. |
-
net7.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 |
---|---|---|
7.0.1 | 238 | 7/27/2025 |
7.0.0 | 917 | 4/22/2025 |
6.1.5 | 1,957 | 2/25/2025 |
6.1.3 | 670 | 11/27/2024 |
6.1.2 | 291 | 11/16/2024 |
6.1.1 | 175 | 10/31/2024 |
6.1.0 | 174 | 10/31/2024 |
6.0.4 | 195 | 10/13/2024 |
6.0.3 | 247 | 9/4/2024 |
6.0.2 | 159 | 9/3/2024 |
6.0.1 | 161 | 9/1/2024 |
6.0.0 | 195 | 8/7/2024 |
5.0.4 | 2,545 | 4/16/2024 |
5.0.3 | 537 | 11/18/2023 |
5.0.2 | 295 | 10/29/2023 |
5.0.1 | 176 | 10/29/2023 |
5.0.0 | 199 | 10/28/2023 |
4.2.1 | 352 | 9/2/2023 |
4.2.0 | 2,335 | 4/24/2023 |
4.1.6 | 305 | 4/24/2023 |
4.1.5 | 419 | 3/19/2023 |
4.1.4 | 415 | 3/14/2023 |
4.1.3 | 373 | 3/14/2023 |
4.1.2 | 334 | 3/14/2023 |
4.1.1 | 924 | 3/10/2023 |
4.1.0 | 375 | 3/9/2023 |
4.0.9 | 368 | 3/9/2023 |
4.0.8 | 359 | 3/9/2023 |
4.0.7 | 387 | 3/6/2023 |
4.0.6 | 406 | 3/3/2023 |
4.0.5 | 397 | 3/1/2023 |
4.0.4 | 481 | 2/24/2023 |
4.0.3 | 437 | 2/23/2023 |
4.0.2 | 1,226 | 1/7/2023 |
4.0.1 | 478 | 1/6/2023 |
4.0.0 | 461 | 1/4/2023 |
3.0.4.2 | 848 | 12/22/2022 |
3.0.3.9 | 1,404 | 12/9/2022 |
3.0.3.8 | 829 | 11/8/2022 |
3.0.3.7 | 592 | 10/27/2022 |
3.0.3.6 | 618 | 10/18/2022 |
3.0.3.5 | 514 | 10/18/2022 |
3.0.3.4 | 1,185 | 9/20/2022 |
3.0.3.3 | 1,347 | 5/19/2022 |
3.0.3.2 | 561 | 5/17/2022 |
3.0.3.1 | 563 | 5/17/2022 |
3.0.3 | 567 | 5/17/2022 |
3.0.2 | 574 | 5/15/2022 |
Increase version to 4.0.6
minor bugfixes