[Paper Review] On Weighted k-mer Dictionaries
This paper presents a new multi-threaded and external-memory construction algorithm for PTHash, a minimal perfect hashing scheme known for its fast lookup performance. By avoiding the overhead of partitioning, the method scales efficiently to large datasets while maintaining PTHash's 2–6× faster lookup speed compared to competing techniques, even when built in parallel or using external storage.
A function $f : U o \{0,\ldots,n-1\}$ is a minimal perfect hash function for a set $S \subseteq U$ of size $n$, if $f$ bijectively maps $S$ into the first $n$ natural numbers. These functions are important for many practical applications in computing, such as search engines, computer networks, and databases. Several algorithms have been proposed to build minimal perfect hash functions that: scale well to large sets, retain fast evaluation time, and take very little space, e.g., 2 - 3 bits/key. PTHash is one such algorithm, achieving very fast evaluation in compressed space, typically several times faster than other techniques. In this work, we propose a new construction algorithm for PTHash enabling: (1) multi-threading, to either build functions more quickly or more space-efficiently, and (2) external-memory processing to scale to inputs much larger than the available internal memory. Only few other algorithms in the literature share these features, despite of their big practical impact. We conduct an extensive experimental assessment on large real-world string collections and show that, with respect to other techniques, PTHash is competitive in construction time and space consumption, but retains 2 - 6$ imes$ better lookup time.
Motivation & Objective
- To enable parallel and external-memory construction of PTHash for large-scale key sets.
- To overcome the performance and space overhead of traditional partitioning approaches in MPH construction.
- To maintain PTHash’s superior lookup speed while scaling construction to billions of keys.
- To provide a unified algorithm that seamlessly adapts to sequential/internal, parallel/internal, sequential/external, and parallel/external memory settings.
Proposed method
- Proposes a new general construction algorithm for PTHash that avoids partitioning by processing keys in a way compatible with multi-threading and external memory.
- Uses a two-phase bucketing strategy with thresholds p1 = 0.6n and p2 = 0.3m to logically partition keys into high- and low-load buckets.
- Applies McDiarmid’s inequality to show that the load factor α≥t is tightly concentrated around its expectation, ensuring predictable performance.
- Employs Poisson approximation for bucket sizes to derive bounds on expected number of trials during construction.
- Integrates multi-threading by allowing independent processing of key segments in parallel, with load balancing across threads.
- Supports external memory by streaming input data and processing it in chunks, minimizing in-memory footprint.
Experimental results
Research questions
- RQ1Can PTHash construction be efficiently parallelized without sacrificing space efficiency or lookup speed?
- RQ2Can PTHash be scaled to inputs larger than main memory using external storage?
- RQ3How does the new construction compare to partitioning-based approaches in terms of construction time, space, and lookup performance?
- RQ4Does the new algorithm maintain PTHash’s 2–6× lookup speed advantage under parallel and external-memory execution?
- RQ5What theoretical guarantees can be provided for the expected number of trials during construction under the new method?
Key findings
- The new PTHash construction achieves 2–6× faster lookup times than competing techniques, even when built in parallel or using external memory.
- Construction time and space usage are competitive with state-of-the-art methods that support parallelism and external memory.
- The method avoids the 30–50% lookup slowdown and 20% space increase typically seen in partitioned MPHFs.
- Theoretical analysis confirms that the expected number of trials per bucket is bounded by a constant for large buckets and grows slowly for small buckets.
- The algorithm scales efficiently across all four settings: sequential/internal, parallel/internal, sequential/external, and parallel/external memory.
- Empirical evaluation on real-world string collections (tens of millions to several billions of strings) confirms high performance and scalability.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.