PaC-trees: Supporting Parallel and Compressed Purely-Functional Collections

Laxman Dhulipala, Guy E. Blelloch, Yan Gu, Yihan Sun
4/12/2022
cs.DScs.DC

Official code: ParAlg/CPAM (27 stars, C++, MIT, last commit 2025-08-18).

Abstract

Many modern programming languages are shifting toward a functional style for collection interfaces such as sets, maps, and sequences. Functional interfaces offer many advantages, including being safe for parallelism and providing simple and lightweight snapshots.

Show full abstract

However, existing high-performance functional interfaces such as PAM, which are based on balanced purely-functional trees, incur large space overheads for large-scale data analysis due to storing every element in a separate node in a tree. This paper presents PaC-trees, a purely-functional data structure supporting functional interfaces for sets, maps, and sequences that provides a significant reduction in space over existing approaches. A PaC-tree is a balanced binary search tree which blocks the leaves and compresses the blocks using arrays. We provide novel techniques for compressing and uncompressing the blocks which yield practical parallel functional algorithms for a broad set of operations on PaC-trees such as union, intersection, filter, reduction, and range queries which are both theoretically and practically efficient. Using PaC-trees we designed CPAM, a C++ library that implements the full functionality of PAM, while offering significant extra functionality for compression. CPAM consistently matches or outperforms PAM on a set of microbenchmarks on sets, maps, and sequences while using about a quarter of the space. On applications including inverted indices, 2D range queries, and 1D interval queries, CPAM is competitive with or faster than PAM, while using 2.1--7.8x less space. For static and streaming graph processing, CPAM offers 1.6x faster batch updates while using 1.3--2.6x less space than the state-of-the-art graph processing system Aspen.

View on arXivView PDF

Code Implementations(1)

ParAlg/CPAMOfficial100%
MIT

CPAM: Compressed Parallel Augmented Maps

278C++, StarlarkApr 12, 20221 years agoMIT

Similar Papers

Cite this paper

@article{dhulipala2022pactrees,
  title  = {PaC-trees: Supporting Parallel and Compressed Purely-Functional Collections},
  author = {Laxman Dhulipala and Guy E. Blelloch and Yan Gu and Yihan Sun},
  year   = {2022},
  eprint = {2204.06077},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.06077}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2204.06077.svg)](https://codeofpaper.com/paper/2204.06077)

Discussion