\[ \newcommand{\inv}{^{-1}} \newcommand{\di}{\delta\inv} \newcommand{\poly}{\mathrm{poly}} \]

This post summarizes some recent results and idea on various types hash tables. Collected together with Stefan Walzer.

1 Types of hash tables Link to heading

Open addressing
Elements are stored in a single (slot) array with no additional metadata.
Stable
As soon as an element is inserted, it does not move (apart from resizing).
Greedy
When inserting an element, the first empty slot found in the probe sequence is where it will go.
Oblivious
The probe sequence for a key \(x\) is \(h_1(x)\), \(h_2(x)\), \(\dots\), without depending on (meta)data in the hash table.
Dynamic resizing
The load factor is high at every point in time.
Fixed-capacity
The opposite of dynamic resizing, when the table is always near-full.
Independent hash functions
Some hash tables require fully random hash functions, while for others, $O(1)$-independence is enough.

2 Metrics Link to heading

Universe size \(u\)
Keys are chosen in \(0\leq k < u\). We may use \(w := \lg u = \lg_2 u\).
Hash table size \(n\)
The hash table contains \(n\) slots.
Elements \(k\)
We have \(k\) distinct keys.
Load factor
\(k/n = 1-\delta\) of the slots are filled. Also \(1-\varepsilon\) is used. I’ll call \(\delta=\varepsilon\) the slack or overhead, but neither seems standardized.

Generally, the goal of this line of research is to make dense hash tables with overhead as close to 0 as possible.

We can then measure query, insertion, and deleting time (together called operations). Almost always, an expectation over the random hashes is taken. Then, one can consider e.g. (from strong to weak):

  • Constant time operations, with high probability1, and so this implies constant time in expectation.
  • \(O(1)\) worst case expected time.
  • \(O(1)\) amortized expected time.

3 Lower bounds Link to heading

Static set
The entropy of choosing \(n\) elements2 of \(u\) is \[\lg \binom un \approx n \lg u - n \lg n,\] ans this is a lower bound on the size of a hash table. In particular, this is less than the \(n \lg u\) bits needed to list the keys.

4 Iceberg hashing (2023) Link to heading

See Bender et al. (2023)

  • \(\delta = o(1)\)
  • stable, apart from resizing
    • (Either resize in bulk, or de-amortize and be unstable for a while.)
  • \(\lg \binom un + n \lg lg n\) space, which is optimal
  • dynamic resizing
  • \(O(1)\) queries whp
  • \(1+o(1)\) cache misses

5 IcebergHT (2023) Link to heading

See Pandey et al. (2023)

Figure 1: Screenshot from Pandey et al. (2023).

Figure 1: Screenshot from Pandey et al. (2023).

6 Tight Bounds for Classical Open Addressing (2024) Link to heading

See Bender, Kuszmaul, and Zhou (2024).

Introduces rainbow hashing:

  • \(O(1)\) expected-time queries,
  • \(O(\lg \lg \di)\) expected-time insertions and deletions, and this is optimal.
  • Also supports dynamic resizing, with no further cost.
  • First work to have \(o(\di)\) complexity for all of insertion, deletion, and queries simultanuously.

7 Optimal Non-oblivious Open Addressing (2025) Link to heading

See Bender, Kuszmaul, and Zhou (2025b).

  • \(\delta=0\), ie completely full table.
  • Dynamic resizing.
  • \(O(1)\) hash functions that are $O(1)$-wise independent.

Non-oblivious: information is stored in the order of the keys, and this is used to speed up probing. But how exactly?

Where there are \(n\) elements in an array, their order encodes \(\log n! = \Theta(n \log n)\) bits of information that we could exploit.

Universe reduction: if \(u = \Omega(\poly(n))\), when we can (whp) use a random hash function to injectively map all keys into a smaller universe of size \(u’ = \poly(n)\).

Partner hashing: This is the crux to using the stored elements. We can put a different element \(y\) in the preferred location of a key \(x\), and then \(x\) gets send to \(y\)’s location. But I haven’t fully understood the details yet.

8 Optimal Bounds for Open Addressing Without Reordering Link to heading

See also this earlier post.

8.1 Funnel hashing Link to heading

See (Farach-Colton, Krapivin, and Kuszmaul 2024).

  • \(O(1)\) amortized probe complexity
  • \(O(\log^2 \di)\) worst-case expected queries
  • \(O(\log \di)\) (worst-case?) insertions?

8.2 Elastic hashing Link to heading

  • \(O(1)\) amortized probe complexity
  • \(O(\log \di)\) worst-case expected queries
  • \(O(\log \di)\) (worst-case?) insertions?

9 Notes on filters Link to heading

  • Xor filter: xor 3 random slots
  • fuse filter: xor 3 slots from adjacent segments
  • Binary Fuse Filter: segments have power-of-2 size

Given are \(n\) \(b\)-bit elements. Build a data structure that

9.1 Elias-Fano Link to heading

9.2 Bloom filter Link to heading

9.3 Xor filter Link to heading

9.4 Ribbon retrieval Link to heading

9.5 Fuse filter Link to heading

9.6 Binary fuse filter Link to heading

9.7 Quotienting cuckoo hashing Link to heading

9.8 Cuckoo + 8-bit bumping filter Link to heading

10 Papers Link to heading

10.1 asd Link to heading

10.2 (NO_ITEM_DATA:cuckoo-hashing-fast-insertion) Link to heading

  • try new priotized bumping & query algorithm
10.2.1 Bumping probability Link to heading

For each construction algorithm and load factor, the number of keys in its primary location. Last col: number of keys in its predicted location.

Target loadrandom walk primary§3 primary§4 primary§5 primary§5 correct prediction
80%91.41%89.49%89.49%89.48%89.48%
90%83.19%77.84%77.84%77.90%79.60%
95%74.00%64.65%64.65%64.65%75.15%
98%62.69%46.67%52.47%53.19%73.00%
99%56.09%—45.97%48.31%72.40%
99.5%51.87%——40.91%72.56%
10.2.2 Bumping distribution Link to heading

On n=1M keys; bins of size B=8.

  • baseline: random walk
  • oracle: exhaustive BFS search
  • immediate: always check for all keys in a bin if they move to a non-full bin on overflow

95% load:

MethodMean012345+p95
Baseline1.9835.57%16.24%14.59%11.65%8.49%13.46%6
Oracle1.2846.80%20.16%13.65%8.56%5.06%5.77%5*
§32.6930.16%12.14%12.44%11.63%9.99%23.64%8
§42.6930.16%12.14%12.44%11.63%9.99%23.64%8
§52.6930.20%12.18%12.43%11.54%9.94%23.71%8
§4 immediate1.3745.21%19.60%13.84%8.96%5.64%6.75%5*
§5 immediate1.3246.33%19.69%13.56%8.75%5.34%6.33%5*

98% load

MethodMean012345+p95
Baseline2.9319.74%14.10%15.18%14.37%12.10%24.51%7
Oracle1.5836.55%22.96%15.94%10.52%6.40%7.63%5*
§34.1814.99%8.55%10.42%11.46%11.62%42.96%10
§43.7318.36%10.11%11.30%11.86%11.45%36.92%9
§53.6718.93%10.22%11.40%11.91%11.35%36.19%9
§4 immediate1.9930.71%20.27%16.21%12.10%8.31%12.40%6
§5 immediate1.8233.42%21.08%16.07%11.39%7.57%10.47%6

46.80% + 20.16% + 13.65% + 8.56% + 5.06% + 10.77% 46.33% + 19.69% + 13.56% + 8.75% + 5.34% + 6.33%

10.2.3 Bloom filter quality for oracle=BFS Link to heading

Using the oracle’s full bumped-key histograms, averaged over all bins:

  • 1hot, m bits: pₖ=1-(1-1/m)ᵏ.
  • Two independent parts: square the corresponding 1hot probability.
  • 2hot, m bits: pₖ=1-2(1-2/m)ᵏ+((m-2)(m-3)/(m(m-1)))ᵏ.
FilterTotal bits/bin95% load98% load
1hot 64bit641.9558%2.4133%
2hot 64bit640.3357%0.4304%
3hot 64bit640.1270%0.1674%
4hot 64bit640.0746%0.1003%
5hot 64bit640.0575%0.0785%
6hot 64bit640.0528%0.0730%*
7hot 64bit640.0545%0.0760%
8hot 64bit640.0607%0.0851%
(1hot 32bit)²640.3884%0.4950%
1hot 32bit323.8378%4.7310%
2hot 32bit321.2170%1.5538%
3hot 32bit320.7769%1.0140%
4hot 32bit320.6979%0.9231%*
5hot 32bit320.7480%0.9971%
6hot 32bit320.8788%1.1761%
7hot 32bit321.0804%1.4475%
8hot 32bit321.3536%1.8120%
(1hot 16bit)²321.3971%1.7730%
k(k-hot 32bit)², 95%98%(k-hot 16bit)², 95%98%
10.38842%0.49502%1.39713%1.77302%
20.08034%0.10773%* 0.74265%* 0.97984%
3* 0.05532%* 0.07630%0.90976%1.21567%
40.06259%0.08762%1.38284%1.84945%
50.08757%0.12329%2.16349%2.88011%
60.13289%0.18712%3.28770%4.34568%
70.20550%0.28846%4.78265%6.27136%
80.31443%0.43925%6.66226%8.66568%

The best split choices are close to the best unsplit filters:

  • 64 total bits: (3hot 32bit)² gives 0.05532% / 0.07630%, versus 6hot 64bit at 0.0528% / 0.0730%.
  • 32 total bits: (2hot 16bit)² gives 0.74265% / 0.97984%, versus 4hot 32bit at 0.6979% / 0.9231%.
10.2.4 BFS bumping results (n=1M) Link to heading
TableTarget loadPrimary keys: walk → BFSFilter passes: walk → BFS
Inline 1-hot95%71.2% → 81.5%2.93% → 1.91%
Inline 1-hot98%59.9% → 77.9%4.15% → 2.33%
Quotient 1-hot98%62.6% → 79.8%4.48% → 2.49%
  • Secondary locations are ~2x more rare
  • Filters become sparser, because fewer keys are bumped.
10.2.5 BFS query results Link to heading

The completed BFS run shows a query-time benefit in return:

TableLoadSingle-thread prefetch2 improvement192-thread improvement
Inline filtered95%14.6%5.8%
Inline filtered98%21.2%10.6%
Quotient + filtered95%13.5%4.4%
Quotient + filtered98%21.0%9.1%

massive query time improvements :)

11 New ideas Link to heading

11.1 Quotienting bucketed cuckoo Link to heading

11.1.1 Done Link to heading
  • \(m\) buckets of size \(b\)
  • key \(x\) maps to \((mx)/2^{64}\) with stored value \(mx\bmod 2^{64}\)
  • the stored value is prepended with a 1-bit for the secondary location
  • use an 8-bit SIMD table filter or 16-bit filter inside the cache line
    • 16-bit prefix seems best
  • never insert values with remainder 0 so we can 0-pad and avoid storing a size
    • instead, those always go in their secondary slot.
  • we already use an invertable hash
  • use that input range is bounded to 62-bit keys
TODO 11.1.2 Link to heading

11.2 Idea: randomly map to a cache line, then optimal inside it Link to heading

  • S bits per bin of size B
  • poisson distribution over those
  • \(a = \ln(2) \cdot S/B = 0.69 S/B\)
  • FPR: $$e-B ⋅ ∑k=1^∞ (B^k / k!) ⋅ 2-S/k = 2-S/B ⋅ (1
    • a(a-2)/2B)$$

Table for the space overhead with \(S\) bit bins and target FPR \(2^{-k}\).

kS = 128 bitsS = 256 bitsS = 512 bitsS = 1024 bits
41.27%0.62%0.31%0.15%
811.07%5.54%2.77%1.39%
1229.14%14.58%7.33%3.68%
1656.82%27.81%13.93%7.01%
2097.51%45.77%22.62%11.37%
24157.20%69.49%33.55%16.75%
32381.14%141.42%63.36%30.76%
6425227.11%1861.84%417.45%150.69%

References Link to heading

Bender, Michael A., Alex Conway, Martín Farach-Colton, William Kuszmaul, and Guido Tagliavini. 2023. “Iceberg Hashing: Optimizing Many Hash-Table Criteria at Once.” Journal of the Acm 70 (6): 1–51. https://doi.org/10.1145/3625817.
Bender, Michael A., William Kuszmaul, and Renfei Zhou. 2024. “Tight Bounds for Classical Open Addressing.” In 2024 Ieee 65th Annual Symposium on Foundations of Computer Science (Focs), 636–57. IEEE. https://doi.org/10.1109/focs61266.2024.00047.
———. 2025a. “Optimal Non-Oblivious Open Addressing.” arXiv. https://doi.org/10.48550/arXiv.2503.13628.
———. 2025b. “Optimal Non-Oblivious Open Addressing.” In Proceedings of the 57th Annual Acm Symposium on Theory of Computing, 268–77. Stoc ’25. ACM. https://doi.org/10.1145/3717823.3718215.
Farach-Colton, Martin, Andrew Krapivin, and William Kuszmaul. 2025. “Optimal Bounds for Open Addressing without Reordering.” arXiv; arXiv. https://doi.org/10.48550/arXiv.2501.02305.
Farach-Colton, Martín, Andrew Krapivin, and William Kuszmaul. 2024. “Optimal Bounds for Open Addressing without Reordering.” In 2024 Ieee 65th Annual Symposium on Foundations of Computer Science (Focs), 594–605. IEEE. https://doi.org/10.1109/focs61266.2024.00045.
Pandey, Prashant, Michael A. Bender, Alex Conway, Martin Farach-Colton, William Kuszmaul, Guido Tagliavini, and Rob Johnson. 2023. “IcebergHT: High Performance Hash Tables through Stability and Low Associativity.” Proceedings of the Acm on Management of Data 1 (1): 1–26. https://doi.org/10.1145/3588727.
NO_ITEM_DATA:cuckoo-hashing-fast-insertion
NO_ITEM_DATA:engineering-cuckoo-hashing
NO_ITEM_DATA:blocked-bloom-filter-with-choices
NO_ITEM_DATA:smaller-flexible-cuckoo-filters
NO_ITEM_DATA:cuckoo++
NO_ITEM_DATA:compact-parallel-gpu-hash-tables
NO_ITEM_DATA:better-gpu-hash-tables
NO_ITEM_DATA:amq-space-lower-bound
Problemdifftime of AC
D1%5 min
E5%10 min
G14%18 min
A22%25 min
K34%35 min
B53%50 min
H64%65 min
F76%85 min
C85%110 min
I93%150 min
L96%180 min
J98%210 min

  1. W.h.p. means with probability \(1-O(1/n^c)\) for every \(c>0\), assuming data-structure constants are suitably chosen dependent on \(c\). ↩︎

  2. It’s a bit confusing that we have \(k\) keys in \(n\) slots but use \(n\) in such formulas. But since the load factor is close to \(1\), it doesn’t really matter. ↩︎