
IcebergHT Dash CLHT
Insertion Deletion
0
5
10
15
20
25
Throughput(M/s)
Pos Query Neg Query
0
20
40
60
80
Figure 1: Throughput for insertions, deletions, and queries
(positive and negative) using 16 threads for PMEM hash
tables. The throughput is computed by inserting
0
.
95
𝑁
keys-value pairs where 𝑁is the initial capacity of the hash
table. (Throughput is Million ops/second)
deleted or the table is resized [
17
,
20
,
42
]. Stability oers a number
of desirable properties. For example, stability enables simpler
concurrency-control mechanisms and thus reduces the performance
impact of locking. Moreover, since elements are not moved, writing
is minimized, which improves PMEM performance.
The
associativity
of a hash table is the number of locations
where an element is allowed to be stored.
2
The best known
low-associative (DRAM) hash table is the cuckoo hash table [
37
,
38
].
In the original design, each element has exactly two locations
in the table where it is allowed to be stored, meaning that the
associativity is two. Low associativity yields a dierent set of
desirable properties—most importantly, it helps search costs. For
example, searching for an element in a cuckoo hash table is fast
because there are only two locations in the table to check. In
addition, low associativity can enable us to further improve query
performance by keeping a small amount of metadata; see Section 2.
In combination, stability can be used to achieve high insertion
throughput in PMEM, where writes are expensive, and low associa-
tivity can be use to achieve high query performance. Furthermore,
we also show how stability enables locking and concurrency-control
mechanisms to be simplied, leading to better multithreaded scaling
and simpler designs for crash consistency.
Unfortunately, there is a tension between stability and low
associativity. If a hash table has associativity
𝛼
, and elements
cannot move once they are inserted, then an unlucky choice of
𝛼
locations for
𝛼
elements can block a
(𝛼+
1
)
st element from being
inserted. As
𝛼
decreases, the probability of such an unlucky event
increases. Cuckoo hashing reduces the probability of these bad
events by giving up stability via kickout chains, which are chains
of elements that displace each other from one location to another.
Practical implementations [
23
] generally increase the number
of elements that can be stored in a given location—and thus the
associativity—to reduce the kickout-chain length and increase the
maximum-allowed
load factor
, i.e, the ratio of the total number
of keys in the table to the overall capacity of the table.
Similarly, there is a three-way tension between space eciency,
associativity, and stability. For example, cuckoo hash tables can
be made stable if they are overprovisioned so much that the
2
Associativity is often associated with caches that restrict the locations an item may
be stored in. Here we refer to data structural associativity, which is a restriction on
how many locations a data structure may choose from to put an item in, even on fully
associative hardware.
kickout-chain length reaches 0. Such overprovisioning directly
decreases space eciency, but it also increases associativity. Linear
probing hash tables are stable (assuming they use tombstones to
implement delete) but, as the load factor approaches 1, the average
probe length for queries goes up, increasing associativity. Other
open-addressing hash tables have a similar space/associativity
trade-o. Chaining hash tables are stable, but they have large
associativity and signicant space overheads. CLHT [
9
] improves
query performance despite high associativity by storing multiple
items in each node, but this further reduces space eciency.
IcebergHT is based on a new type of hash table, which we call
iceberg hashing
. Iceberg hash tables are the rst to simultaneously
achieve low associativity and stability, and they also have small
space consumption. To date, hash tables have had to choose between
stability (e.g., chaining), low associativity (e.g., cuckoo) or neither
(e.g., Robin Hood [
1
,
5
]). The techniques introduced in this paper
also have ramications to the theoretical study of hash tables—we
present a detailed study of these implications, including closing
various theoretical open problems, in a companion manuscript [
2
].
We describe Iceberg hash tables in Section 2.
Results.
In this paper, we introduce Iceberg hashing and its
implementation, IcebergHT. We prove that Iceberg hashing
simultaneously achieves stability and low associativity. Iceberg
hashing is the rst hash-table design to achieve both properties.
These guarantees give IcebergHT excellent performance on PMEM,
as well as on DRAM, and for workloads ranging from read-heavy to
write-heavy. Specically, IcebergHT accesses very few cache lines,
both for queries and insertions, has low CPU cost, and has high
load factor (and thus small space), with high probability. Stability
and low associativity enable simpler concurrency mechanisms, so
that IcebergHT achieves nearly linear scaling with the number of
threads, and it is crash safe on PMEM.
In building IcebergHT, based on our Iceberg hash table, we oer
the following design contributions:
(1)
We show how to achieve an ecient, practical metadata
scheme that is adapted to practical hardware constraints.
The metadata scheme is small enough that the metadata for a
bucket ts in a cache line, improving query performance and
enabling nearly lock-free concurrency, i.e., locks are needed
only for resizing.
(2)
A highly concurrent and thread-safe implementation of
Iceberg hashing. IcebergHT can scale almost linearly with
increasing threads in PMEM, as well as DRAM, experiments.
(3) Fenceless crash safety on PMEM. Achieving crash-safety on
PMEM often requires controlling the order in which cache
lines get ushed to persistent storage, e.g., to ensure that
an undo-log entry gets persisted before the changes to the
hash table get persisted. Since insertions in our hash table
modify only a single cache line, we can achieve crash safety
by simply persisting that cache line.
(4)
A simple, high-performance and concurrent technique
for eciently resizing Iceberg hash tables in a lazy online
manner, thus reducing the worst-case latency of insertions.
Performance.
We evaluated IcebergHT on a system with Intel
Optane memory. We nd that: