Broadword Implementation of Parenthesis Queries
Sebastiano Vigna

TL;DR
This paper introduces efficient broadword algorithms for parenthesis matching and k-th far closed parenthesis queries, achieving significant speedups on modern architectures by avoiding branches and tabulations.
Contribution
It extends broadword techniques to parenthesis queries, providing branchless, test-free algorithms with logarithmic time complexity that outperform traditional methods.
Findings
Algorithms run in O(log w) time on w-bit words.
No branch or test instructions are needed.
Significant speedup over traditional implementations.
Abstract
We continue the line of research started in "Broadword Implementation of Rank/Select Queries" proposing broadword (a.k.a. SWAR, "SIMD Within A Register") algorithms for finding matching closed parentheses and the k-th far closed parenthesis. Our algorithms work in time O(log w) on a word of w bits, and contain no branch and no test instruction. On 64-bit (and wider) architectures, these algorithms make it possible to avoid costly tabulations, while providing a very significant speedup with respect to for-loop implementations.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · Advanced Database Systems and Queries · Data Management and Algorithms
