NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

The Fast Fibonacci Decompression Algorithm

Radim Baca, Václav Snásel, Jan Platos, Michal Krátký, Eyas El-QawasmeharXiv 2007

TL;DR

This paper introduces a significantly faster algorithm for decompressing data encoded using Fibonacci coding. By leveraging a novel "Fibonacci shift" operation and precomputed lookup tables, their method achieves up to a 3.5x speedup over existing implementations, making it suitable for real-time applications where decompression speed is critical.

What Problem Does This Paper Address?

Data compression is widely used, but the efficiency of decompression is often overlooked compared to compression itself. However, in certain scenarios, such as real-time decompression of data structures (like tree pages) from secondary storage into main memory, a slow decompression algorithm can become a bottleneck. The authors focus on Fibonacci coding, a method particularly useful for compressing small integers, and aim to accelerate its decompression process to meet the demands of these time-sensitive applications.

Methods

The core of the paper's contribution lies in a "Fast Fibonacci Decompression Algorithm" that replaces bit-by-bit processing with a more efficient approach. Key techniques include:

  • Precomputed Mapping Tables (MAP1 and MAP2): Instead of decoding each bit individually, the algorithm uses lookup tables that map segments of compressed data (e.g., 1 byte) directly to decompressed numbers. Two tables are used to handle cases where a segment might start or end in a way that requires information from the previous or next segment.
  • Fibonacci Shift Operation: A novel operation, the "Fibonacci shift," is introduced. This operation allows for efficient manipulation of Fibonacci-encoded numbers, enabling the algorithm to process larger chunks of data at once. The paper formally defines and proves properties of this shift operation.
  • Algorithm 1: This algorithm orchestrates the decompression by iterating through segments of compressed data, consulting the mapping tables, and using the lastNumber and shift variables to manage partially decompressed numbers and bit shifts between segments.

Datasets

The paper does not introduce new datasets but uses several collections of numbers for evaluation:

  • Sequential Collections:
    • SEQ_ALL: Numbers from 1 to 4,194,304.
  • SEQ-VerySmall: Numbers from 1 to 255.
  • SEQ_Small: Numbers from 256 to 65,535.
  • SEQ-Large: Numbers from 65,536 to 16,777,215.
  • SEQ-Very Large: Numbers from 16,777,216 to 4,294,967,295.
  • Random Collections: Similar ranges as the sequential collections, but with random numbers.

All collections contain 2^22 = 4,194,304 numbers, with the maximum value being 2^32 - 1 (32-bit binary number).

Key Insights and Ideas

  • Decompression Speed Matters: The paper strongly emphasizes that for certain real-time applications, decompression efficiency is paramount, often more so than compression speed.
  • Lookup Tables Revolutionize Decoding: The shift from bit-by-bit processing to segment-based lookup tables is the primary driver of the speedup. This is a common strategy in high-performance data processing.
  • Fibonacci Shift as a Core Primitive: The introduction of the Fibonacci shift operation is a novel contribution that enables the efficient manipulation of Fibonacci-encoded data within the lookup table framework.
  • Trade-off Between Table Size and Speed: While the mapping table size grows exponentially with segment size, the authors demonstrate that even small segment sizes (like 1 byte) yield significant performance improvements, making the exponential space complexity manageable in practice.

Key Results

The primary quantitative result is the significant speedup achieved by the Fast Fibonacci Decompression Algorithm:

  • Speedup Factor: The proposed algorithm is up to 3.5x faster than the original implementation.
  • Sequential Collections: Achieved an average speedup of 3.73x.
  • Random Collections: Achieved an average speedup of 3.52x.
  • Decoding Efficiency: Figure 2 shows that for individual numbers, the fast algorithm is more than 3.5x faster.

Limitations and Future Work

  • Limitations: The paper acknowledges that the original Fibonacci compression algorithm is more efficient than its original decompression counterpart, which is why they focus on improving decompression. The space complexity of the mapping tables is exponential with segment size, though they argue this is manageable for practical segment sizes.
  • Future Work: Not explicitly detailed, but the success of this approach suggests potential applications in other areas requiring fast decompression of variable-length codes, and further optimization of the mapping table creation or lookup process could be explored.

Summary updated

BibTeX
@misc{baca2007fast,
  author = {Radim Baca and Václav Snásel and Jan Platos and Michal Krátký and Eyas El-Qawasmeh},
  title = {{The Fast Fibonacci Decompression Algorithm}},
  year = {2007},
  eprint = {0712.0811},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/0712.0811},
}

Loading related content...

Figure