Skip to content

Commit 594d2e4

Browse files
committed
update README.md
1 parent e454649 commit 594d2e4

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ These standard collections are widely used for key-value pair storage in .NET ap
2424
- [Installation](#installation)
2525
- [Basic Usage](#basic-usage)
2626
- [Advanced Usage](#Advanced-usage)
27+
- [Selecting the Right Hashmap](#selecting-the-right-hashmap)
2728
- [Tested Platforms](#tested-on-platforms)
2829
- [Benchmarks](#benchmarks)
2930
- [📊 Get Benchmark](#-get-benchmark)
@@ -117,6 +118,26 @@ Using **custom hashing** can significantly reduce collisions and improve lookup
117118
* arm
118119
* arm64
119120

121+
## Selecting the Right Hashmap
122+
123+
Choosing the right hashmap depends on the workload, concurrency requirements, and expected load factors:
124+
125+
- **DenseMap**: **Really shines when the table is nearly full**, showing **incredible performance**. Note that **DenseMap's load factor can easily exceed the 0.8 used in benchmarks**, making it a strong choice for high-density scenarios.
126+
- **RobinHoodMap**: **Probably your best choice when you only care about retrieval speed**. Performs well at moderate load factors (**≤0.5**) and is ideal when stability in retrieval times is critical.
127+
- **CMap**: The best choice for **multi-threaded applications** where **lock-free** operations are essential. Suitable for workloads requiring frequent concurrent reads and writes without significant synchronization overhead.
128+
- **BlitzMap**: **Usually the winner in most benchmarks**. It is incredibly fast in **most situations** and provides **consistent performance across all load factors**. However, it is **not recommended to exceed a load factor of 0.8**, as performance can degrade beyond this threshold.
129+
130+
### ✅ Summary of Recommendations:
131+
132+
| Hashmap | Best Use Case |
133+
| ---------------- | --------------------------------------------------- |
134+
| **DenseMap** | High-performance, large datasets, SIMD acceleration, excellent at high load factors |
135+
| **RobinHoodMap** | Best for retrieval-heavy workloads, moderate load factors (≤0.5) |
136+
| **CMap** | Multi-threaded applications, lock-free performance |
137+
| **BlitzMap** | General-purpose, predictable performance, fastest in most cases but avoid high load factors |
138+
139+
---
140+
120141
## Benchmark
121142

122143
``` ini

0 commit comments

Comments
 (0)