2015-01-06 14:41:20 +01:00
2015-01-06 14:28:11 +01:00
2015-01-03 15:30:46 +01:00
2015-01-06 14:28:11 +01:00
2015-01-06 14:28:11 +01:00

TurboPFor: Fastest Integer Compression Build Status

  • 100% C (C++ compatible headers), without inline assembly

- Fastest **"Variable Byte"** implementation

- Novel **"Variable Simple"** faster than simple16 and more compact than simple8-b

- Scalar **"Bit Packing"** with bulk decoding as fast as SIMD FastPFor in realistic and practical (No "pure cache") scenarios - Bit Packing with **Direct/Random Access** without decompressing entire blocks - Access any single bit packed entry with **zero decompression** - **New:** **Direct Update** of individual bit packed entries - Reducing **Cache Pollution**

- Novel **"TurboPFor"** (Patched Frame-of-Reference) scheme with direct access or bulk decoding. Outstanding compression

- Several times faster than other libraries - Usage in C/C++ as easy as memcpy - Most functions optimized for speed and others for high compression ratio - **New:** Include more functions

- Instant access to compressed *frequency* and *position* data in inverted index with zero decompression - **New:** Inverted Index Demo + Benchmarks: Intersection of lists of sorted integers. - more than **1000 queries per second** on gov2 (25 millions documents) on a **SINGLE** core. - Decompress only the minimum necessary blocks.

Benchmark:

i7-2600k at 3.4GHz, gcc 4.9, ubuntu 14.10, Single thread.

  • Realistic and practical benchmark with large integer arrays.
  • No PURE cache benchmark

Synthetic data:

  • Generate and test skewed distribution</ br>

    ./icbench -a1.5 -m0 -M8 -n100000000

SizeRatio in %Bits/IntegerC Time MB/sD Time MB/sFunction
6339280115.85 5.07 316.96 893.67TurboPFor
6339280115.85 5.07 315.59 227.15TurboPForDA
6535991616.34 5.23 7.09 638.96OptPFD
7236402418.09 5.79 85.31 762.00Simple16
7851427619.63 6.28 229.21 748.32SimpleV
9591509623.98 7.67 221.46 1049.70Simple-8b
9991093024.98 7.99 1553.92 1904.21SIMDPackFPF
9991093024.98 7.99 953.29 1872.02TurboPack
9991093024.98 7.99 953.13 869.84TurboPackDA
10207466325.52 8.17 1131.47 1184.68TurboVbyte
10207466325.52 8.17 1110.75 897.86VbyteFPF
11250000028.12 9.00 305.85 1899.15VarintG8IU
400000000100.0032.00 1470.87 1477.93Copy

data files

SizeRatio in %Bits/IntegerC Time MB/sD Time MB/sFunction
321476368913.444.30279.93 665.41SimpleV 64k
333775885413.954.475.06 513.00OptPFD
335767349514.044.49270.57 813.83TurboPFor
350167131414.644.68258.56 720.76SimpleV
382019018215.975.11118.81 650.21Simple16
452132651818.906.05209.17 824.26Simple-8b
495376834220.716.63647.751501.24TurboPack
520335305721.756.961560.341806.60SIMDPackFPF D1
669951900028.018.96502.86 624.12TurboVbyte
669951900028.018.96472.01 495.12VbyteFPF
762289687831.8710.20208.731197.74VarintG8IU
23918861764100.0032.001391.821420.03Copy

Compile:

make

Testing

Synthetic data:
  1. test all functions
*./icbench -a1.0 -m0 -M8 -n100000000*

- zipfian distribution alpha = 1.0 (Ex. -a1.0=uniform -a1.5=skewed distribution)
- number of integers = 100000000
- integer range from 0 to 255 (integer size = 0 to 8 bits)
  1. individual function test (ex. copy TurboPack TurboPack Direct access)
*./icbench -a1.5 -m0 -M8 -ecopy/turbopack/turbopackda -n100000000*
Data files:
  • Data file Benchmark (file format as in FastPFOR)

    ./icbench -c1 gov2.sorted

Benchmarking intersections
  • Download gov2 (or clueweb09) + query file "aol.txt" from "http://lemire.me/data/integercompression2014.html"

  • Create index file

    ./idxcr gov2.sorted .

    create inverted index file "gov2.sorted.i" in the current directory

  • Benchmarking intersections

    ./idxqry gov2.sorted.i aol.txt

    run queries in file "aol.txt" over the index of gov2 file

8GB RAM required (16GB recommended for benchmarking "clueweb09" files).

Function usage:

In general compression/decompression functions are of the form:

*char *endptr = compress( unsigned *in, int n, char out)
endptr : set by compress to the next character in "out" after the compressed buffer
in : input integer array
n : number of elements
out : pointer to output buffer

*char *endptr = decompress( char *in, int n, unsigned out)
endptr : set by decompress to the next character in "in" after the decompressed buffer
in : pointer to input buffer
n : number of elements
out : output integer array

header files with documentation :
vint.h - variable byte
vsimple.h - variable simple
vp4dc.h,vp4dd.h - TurboPFor
bitpack.h,bitunpack.h - Bit Packing

Reference:

#------------------------------------------------

Description
No description provided
Readme GPL-2.0 6.4 MiB
Languages
C 93.1%
Rust 5.8%
Makefile 0.6%
Java 0.4%