You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,7 @@ These standard collections are widely used for key-value pair storage in .NET ap
24
24
-[Installation](#installation)
25
25
-[Basic Usage](#basic-usage)
26
26
-[Advanced Usage](#Advanced-usage)
27
+
-[Selecting the Right Hashmap](#selecting-the-right-hashmap)
27
28
-[Tested Platforms](#tested-on-platforms)
28
29
-[Benchmarks](#benchmarks)
29
30
-[📊 Get Benchmark](#-get-benchmark)
@@ -117,6 +118,26 @@ Using **custom hashing** can significantly reduce collisions and improve lookup
117
118
* arm
118
119
* arm64
119
120
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.
0 commit comments