README.md

April 11, 2026 ยท View on GitHub

TurboRLE: Turbo Run Length Encoding

Build ubuntu

Efficient and fastest Run Length Encoding library
  • ARM NEON support

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

  • Most efficient compression

  • No other RLE compress or decompress faster with better compression

  • :sparkles: faster compression and 2x faster decompression with :+1: SIMD

  • :+1: Java Critical Natives Interface. Access TurboRLE incl. SIMD! from Java

  • Compress better and up to 12 times faster and decompress up to 6 times faster than other fast RLEs

  • Can be faster than memcpy!

  • :+1: ZERO! byte overhead

  • No modification of the raw data, preserving compressibility for further postprocessing (ex. entropy coding)

  • Order preserving

TurboRLE
  • TRLE: TurboRLE - Efficient and fast Run Length Encoding
  • SRLE: TurboRLE Escape - Fast Run Length Encoding with automatic escape determination

Benchmark:

  • Single thread with TurboBench
  • Realistic and practical benchmark with large files and different distributions
External functions benchmarked
  • MRLE: Mespotine RLE: Run Length Encoding
  • RLE8: A fast 8 bit Run Length Encoding (SSE/AVX2)

CPU: Skylake i7-6700 3.4GHz, gcc 8.3 (2019-08)

(bold = pareto) MB=1.000.000

C Sizeratio%C MB/sD MB/sName / 2019-08
26236800.6208911385trle
41484551.0209512521srle 0 (auto escape)
44823841.137812302mrle
47448061.21130713205srle 8
59012351.589011998rle8 1
84318442.1736812693srle 16
137223113.41109013188srle 32
198397114.91626913733srle 64
403920054100.01397814001memcpy
  • Checkers program "End Game Table Base": 1034.db
C Sizeratio%C MB/sD MB/sName / 2019-08
7310899017.47743020trle
8467175920.27645113srle 0
8805536021.02621491mrle
8866637221.24562669rle8 1
9236916422.011015967srle 8
11356154827.120287114srle 16
13691831132.735889026srle 32
16554736539.5597210120srle 64
419225625100.01393814017memcpy
C Sizeratio%C MB/sD MB/sName / 2019-08
37509408437.54721743trle
41559710441.64613563srle 0
41926392441.95684310srle 8
48743062348.713476287srle 16
54920286054.927808238srle 32
57661994157.7207553mrle
57768525057.8260675rle8 1
60575957860.653569471srle 64
1000000008100.01393113926memcpy

CPU: ARM A73-ODROID-N2 1.8GHz, gcc 8.3 (2019-08)

C Sizeratio%C MB/sD MB/sName / 2019-08
26236800.65943399trle
41484551.05893799srle 0
44823841.11443712mrle
47448061.233653790srle 8
84318442.113133784srle 16
137223113.417714573srle 32
198397114.941846020srle 64
403920054100.033453376memcpy
C Sizeratio%C MB/sD MB/sName / 2019-08
37509408437.5184722trle
41559710441.6180681srle 0
41926392441.9244693srle 8
48743062348.74551203srle 16
54920286054.98252094srle 32
57661994157.794249mrle
60575957860.616773662srle 64
1000000008100.038303841memcpy

  • Post-processing: Entropy Coding after Run Length Encoding
    Direct entropy encoding after "trle" (no additional "move to front" or other transformation)
C Sizeratio%C MB/sD MB/sName / CPU Skylake 3.4 GHz (2019-06)
18051094818.1154132trle + TurboRC o0 (order 0 bitwise Range Coder)
18709949018.7232560trle + TurboHF 0 (Huffman Coding)
19242047119.215273834trle + TurboANX 12 (Asymmetric Numeral Systems)
19345567019.321922986trle + TurboHF 12
19797407819.810781406trle + fse (Finite State Entropy)
22969337623.0126106rle8 + TurboRC o0
25431205625.4119105mrle + TurboRC o0

for more info, see also: Entropy Coding Benchmark

Compile:

	git clone https://github.com/powturbo/Turbo-Run-Length-Encoding.git
    cd Turbo-Run-Length-Encoding
Linux + Windows MingW
	make
    or
	make AVX2=1
Windows Visual C++
	nmake /f makefile.vs
    or
	nmake AVX2=1 /f makefile.vs

Testing Run Length Encoding libraries:

    ./trle file
    ./trle -e# file

	# = function id (see file trle.c)

Environment:

OS/Compiler (32 + 64 bits):
  • Windows: MinGW-w64 makefile
  • Windows: Visual c++ (>=VS2008) - makefile.vs (for nmake)
  • Windows: Visual Studio project file - vs/vs2017
  • Linux amd64: GNU GCC (>=4.6)
  • Linux amd64: Clang (>=3.2)
  • Linux arm64: 64 bits aarch64 ARMv8: gcc (>=6.3)
  • Linux arm64: 64 bits aarch64 ARMv8: clang
  • MaxOS: XCode (>=9)
  • PowerPC ppc64le (incl. SIMD): gcc (>=8.0)

Run Length Encoding References:

Last update: 12 APR 2026