Skip to main content
QUICK REVIEW

[Paper Review] Vectorized VByte Decoding

Jeff Plaisance, Nathan Kurz|arXiv (Cornell University)|Feb 20, 2015
Algorithms and Data CompressionComputer Science4 references21 citations
TL;DR

This paper introduces Masked VByte, a SIMD-optimized VByte decoder that accelerates variable-length integer decoding by eliminating branch mispredictions through vectorized bit manipulation and masked operations. It achieves 2x to 4x speedup over scalar VByte decoders, restoring VByte's competitiveness in performance-critical systems like search engines and databases.

ABSTRACT

We consider the ubiquitous technique of VByte compression, which represents each integer as a variable length sequence of bytes. The low 7 bits of each byte encode a portion of the integer, and the high bit of each byte is reserved as a continuation flag. This flag is set to 1 for all bytes except the last, and the decoding of each integer is complete when a byte with a high bit of 0 is encountered. VByte decoding can be a performance bottleneck especially when the unpredictable lengths of the encoded integers cause frequent branch mispredictions. Previous attempts to accelerate VByte decoding using SIMD vector instructions have been disappointing, prodding search engines such as Google to use more complicated but faster-to-decode formats for performance-critical code. Our decoder (Masked VByte) is 2 to 4 times faster than a conventional scalar VByte decoder, making the format once again competitive with regard to speed.

Motivation & Objective

  • Address the performance bottleneck in VByte decoding caused by unpredictable branch mispredictions in variable-length integer sequences.
  • Revive the competitiveness of the widely used VByte format in performance-critical applications like search engines and databases.
  • Design a SIMD-accelerated decoder that maintains compatibility with existing VByte-compressed data while drastically improving throughput.
  • Enable efficient differential coding for inverted indexes by accelerating gap decoding and prefix sum computation using vectorized operations.

Proposed method

  • Use 128-bit XMM registers to process four 32-bit integers in parallel, loading compressed bytes via movdqu instructions.
  • Apply bit masking and arithmetic operations to extract 7-bit chunks from each byte, using pshufd and pslldq to align and shift values across vector lanes.
  • Perform vectorized prefix sum computation using multiple paddd operations with shifted vectors to accumulate decoded gaps efficiently.
  • Use masked operations to selectively update output values, avoiding conditional branches and eliminating misprediction penalties.
  • Implement a loop unrolling strategy that decodes four integers per iteration using AVX2 instructions, minimizing loop overhead.
  • Integrate the decoder into a differential coding pipeline that computes the original document IDs from decoded gaps using vectorized addition.

Experimental results

Research questions

  • RQ1Can SIMD vectorization eliminate branch misprediction overhead in VByte decoding, which currently limits performance in variable-length integer sequences?
  • RQ2To what extent can a vectorized VByte decoder outperform scalar decoders in real-world workloads such as inverted index decompression?
  • RQ3Does the proposed Masked VByte decoder maintain backward compatibility with existing VByte-compressed data while achieving significant speedups?
  • RQ4How does the performance of the vectorized decoder scale across different levels of compression (i.e., varying gap sizes and list lengths) in real posting lists?
  • RQ5Can the decoder be efficiently integrated into production systems without modifying existing data formats?

Key findings

  • The Masked VByte decoder achieves a peak decoding speed of 2700 million 32-bit integers per second (mis) on compressible posting lists, compared to 1100 mis for the scalar VByte decoder.
  • For less compressible lists, the Masked VByte decoder decodes at 650 mis, outperforming the scalar decoder’s 300 mis, resulting in a 2.2x speedup.
  • In the most favorable compression scenarios, the speedup reaches up to 4x over the scalar decoder, demonstrating strong performance gains for highly compressible data.
  • The performance advantage is reduced by about 15% when decoding to main memory instead of L1 cache, indicating that memory bandwidth becomes a limiting factor.
  • The decoder is deployed in production at Indeed within the open-source Imhotep analytics platform, confirming real-world viability and integration potential.
  • The vectorized approach eliminates branch mispredictions entirely, making it robust across diverse input distributions with mixed integer lengths.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.