Table of Contents
Fetching ...

SPIDER: Improved Succinct Rank and Select Performance

Matthew D. Laws, Jocelyn Bliven, Kit Conklin, Elyes Laalai, Samuel McCauley, Zach S. Sturdevant

TL;DR

SPIDER addresses the enduring tradeoff between space and speed in succinct rank and select data structures by introducing a cache-aware, interleaved metadata scheme for rank and a predictive, multi-level approach for select. It achieves a space overhead of about 3.83% and delivers state-of-the-art rank performance for very large bit vectors, while substantially closing the gap for select queries against structures using more space. A non-interleaved variant (ni-spider) provides a practical alternative when mutating the bit vector is undesirable, maintaining competitive performance with a slightly different cache profile. The combination of interleaving, predictions inspired by learned indices, and multi-level sampling yields practical improvements on both real and synthetic datasets, making SPIDER a significant step toward removing the space-time bottleneck in succinct data structures.

Abstract

Rank and select data structures seek to preprocess a bit vector to quickly answer two kinds of queries: rank(i) gives the number of 1 bits in slots 0 through i, and select(j) gives the first slot s with rank(s) = j. A succinct data structure can answer these queries while using space much smaller than the size of the original bit vector. State of the art succinct rank and select data structures use as little as 4% extra space while answering rank and select queries quickly. Rank queries can be answered using only a handful of array accesses. Select queries can be answered by starting with similar array accesses, followed by a linear scan. Despite these strong results, a tradeoff remains: data structures that use under 4% space are significantly slower at answering rank and select queries than less-space-efficient data structures (using, say, > 20% extra space). In this paper we make significant progress towards closing this gap. We give a new data structure, SPIDER, which uses 3.82% extra space. SPIDER gives the best rank query time for data sets of 8 billion or more bits, even compared to less space-efficient data structures. For select queries, SPIDER outperforms all data structures that use less than 4% space, and significantly closes the gap in select performance between data structures with less than 4% space, and those that use more (over 20%) space. SPIDER makes two main technical contributions. For rank queries, it improves performance by interleaving the metadata with the bit vector to improve cache efficiency. For select queries, it uses predictions to almost eliminate the cost of the linear scan. These predictions are inspired by recent results on data structures with machine-learned predictions, adapted to the succinct data structure setting. Our results hold on both real and synthetic data, showing that these predictions are effective in practice.

SPIDER: Improved Succinct Rank and Select Performance

TL;DR

SPIDER addresses the enduring tradeoff between space and speed in succinct rank and select data structures by introducing a cache-aware, interleaved metadata scheme for rank and a predictive, multi-level approach for select. It achieves a space overhead of about 3.83% and delivers state-of-the-art rank performance for very large bit vectors, while substantially closing the gap for select queries against structures using more space. A non-interleaved variant (ni-spider) provides a practical alternative when mutating the bit vector is undesirable, maintaining competitive performance with a slightly different cache profile. The combination of interleaving, predictions inspired by learned indices, and multi-level sampling yields practical improvements on both real and synthetic datasets, making SPIDER a significant step toward removing the space-time bottleneck in succinct data structures.

Abstract

Rank and select data structures seek to preprocess a bit vector to quickly answer two kinds of queries: rank(i) gives the number of 1 bits in slots 0 through i, and select(j) gives the first slot s with rank(s) = j. A succinct data structure can answer these queries while using space much smaller than the size of the original bit vector. State of the art succinct rank and select data structures use as little as 4% extra space while answering rank and select queries quickly. Rank queries can be answered using only a handful of array accesses. Select queries can be answered by starting with similar array accesses, followed by a linear scan. Despite these strong results, a tradeoff remains: data structures that use under 4% space are significantly slower at answering rank and select queries than less-space-efficient data structures (using, say, > 20% extra space). In this paper we make significant progress towards closing this gap. We give a new data structure, SPIDER, which uses 3.82% extra space. SPIDER gives the best rank query time for data sets of 8 billion or more bits, even compared to less space-efficient data structures. For select queries, SPIDER outperforms all data structures that use less than 4% space, and significantly closes the gap in select performance between data structures with less than 4% space, and those that use more (over 20%) space. SPIDER makes two main technical contributions. For rank queries, it improves performance by interleaving the metadata with the bit vector to improve cache efficiency. For select queries, it uses predictions to almost eliminate the cost of the linear scan. These predictions are inspired by recent results on data structures with machine-learned predictions, adapted to the succinct data structure setting. Our results hold on both real and synthetic data, showing that these predictions are effective in practice.
Paper Structure (40 sections, 1 equation, 5 figures, 3 tables)

This paper contains 40 sections, 1 equation, 5 figures, 3 tables.

Figures (5)

  • Figure 1: Two examples of the values used to create a prediction for $\text{Select$(i)$}$. The example on the left is well-specified, and $i$ must be between $a$ and $b$ in superblock $s$. The example on the right is not well-specified, since $a$ and $b$ are local ranks from different superblocks.
  • Figure 2: Average rank query time in nanoseconds, for bit vectors from 1 billion to 32 billion bits.
  • Figure 3: Average select query time in nanoseconds, for datasets from 1 billion to 32 billion bits.
  • Figure 4: Total build time in milliseconds. The $y$ axis uses a logarithmic scale.
  • Figure 5: Average time for a select query in nanoseconds for the four different variants of SPIDER.