A General SIMD-Based Approach to Accelerating Compression Algorithms

Wayne Xin Zhao, Xudong Zhang, Daniel Lemire, Dongdong Shan, Jian-Yun Nie, Hongfei Yan, Ji-Rong Wen · DOI

Abstract

In modern high-performance computing, the bottleneck for large-scale data processing often lies in disk I/O rather than CPU cycles. While compression is a standard mitigation strategy, traditional scalar compression algorithms fail to exploit the parallel processing capabilities of modern hardware. This paper presents a unified framework that leverages Single Instruction Multiple Data (SIMD) instructions to accelerate diverse integer compression families. By reorganizing data into a 4-way vertical layout, the proposed approach achieves decoding speedups of 40% to 110% across multiple algorithm categories while maintaining competitive compression ratios.

Introduction

Web search engines and large-scale databases rely heavily on inverted indexes to map terms to document locations. As data volumes grow, the latency involved in fetching these indexes from disk to memory becomes a critical performance constraint. While compression reduces the physical data footprint, the computational overhead of decompression can become a new bottleneck if the algorithms are not optimized for modern CPU architectures.

Existing high-performance techniques, such as Simple-9 or PForDelta, were primarily designed for scalar execution—processing one integer at a time. This research addresses the challenge of vectorizing these diverse compression families, moving beyond ad-hoc optimizations toward a systematic, general-purpose SIMD-based framework.

The Core Innovation: 4-Way Vertical Layout

The fundamental shift proposed is the transition from a sequential "horizontal" data layout to a "4-way vertical" organization. This layout is specifically designed to align with 128-bit SIMD registers (such as Intel's SSE), which can process four 32-bit integers simultaneously.

Comparison of horizontal and vertical data layouts for SIMD processing.

In the traditional horizontal layout, integers are stored one after another. In contrast, the vertical layout distributes $n$ consecutive integers into four distinct groups. This reorganization transforms sequential dependencies into parallel processing opportunities. By separating "control patterns" (metadata describing packing density) from "data snips" (the compressed bits), the CPU can load a single control pattern and then use SIMD instructions to process the corresponding data vectors at high speed.

Unified Framework and Algorithm Instantiations

The researchers applied this vertical layout to four major categories of compression algorithms, demonstrating the framework's versatility. As shown in the table below, traditional scalar algorithms were mapped to new, vectorized counterparts.

Mapping of traditional scalar algorithms to the proposed SIMD-based framework.
  1. Group-Simple: A vectorized version of word-aligned codes like Simple-9.
  2. Group-Scheme: A flexible family generalizing bit-aligned (e.g., Elias Gamma) and byte-aligned (e.g., VarByte) codes.
  3. Group-AFOR & Group-PFD: Vectorized versions of frame-based and exception-handling algorithms.

To further optimize encoding, the authors introduced a "quad max array"—a pre-calculated buffer containing the maximum values for every group of four integers. This allows the encoder to avoid expensive conditional branches, significantly increasing throughput.

Experimental Results

The framework was evaluated using four large-scale, diverse datasets: TREC GOV2, ClueWeb09B, Wikipedia, and Twitter. These datasets represent a wide range of data distributions, from formal encyclopedic text to informal microblogging content.

Performance Gains

  • Decoding Speed: The SIMD-based versions consistently outperformed scalar counterparts by 40% to 110%. The SIMD-BP128 variant emerged as the "decoding king," often exceeding 2,000 million integers per second (mis).
  • Encoding Efficiency: The "quad max" optimization allowed Group-Simple to achieve encoding speeds 1.5x to 4x faster than traditional Simple-9/16 implementations.
  • System-Level Impact: When integrated into an experimental search engine, these algorithms significantly improved query processing rates, proving that micro-level compression gains translate directly to macro-level system performance.

Compression Density

While the 4-way alignment introduces a slight amount of "waste" compared to the most tightly packed scalar codes (such as Rice coding), the researchers found the loss to be minimal. The order-of-magnitude increase in speed heavily outweighs the marginal decrease in compression density for most big-data applications.

Conclusion and Future Work

This research demonstrates that seemingly disparate compression styles can be unified under a single SIMD-friendly architectural umbrella. By identifying that the primary bottleneck often lies in decoding "length descriptors," the authors utilized packed decoding with lookup tables to provide an additional 50% speed boost.

Future research directions include extending this logic to 256-bit (AVX-2) and 512-bit (AVX-512) architectures, which could potentially process 8 or 16 integers simultaneously. Additionally, the authors suggest exploring implementations for ARM and PowerPC architectures and applying these techniques to database column-store compression and image processing.

Summary updated

BibTeX
@article{zhao2015general,
  author = {Wayne Xin Zhao and Xudong Zhang and Daniel Lemire and Dongdong Shan and Jian-Yun Nie and Hongfei Yan and Ji-Rong Wen},
  title = {{A General SIMD-Based Approach to Accelerating Compression Algorithms}},
  journal = {ACM Trans. Information Systems},
  year = {2015},
  doi = {10.1145/2735629},
}
Figure