.sloot 🐍

High ratio archiver for Windows and Linux

Download | GitHub

Sloot is an experimental open source archiver written in Rust. Its goal is the best compression ratio you can get at a speed that is still usable. Compressors like paq8 and cmix use context mixing and neural networks to achieve incredible compression ratios, but they run at a few KB per second on one core, so a folder that 7-Zip packs in a minute would take them days. By compressing smarter, not harder, Sloot achieves similar compression ratios at a useable speed, with a real incremental archive format built around it, plus quality of life features like encryption and recovery records.

There is also a GUI, sloot-gui, that works like a basic file manager.

Archive size vs. time to pack 311 MB of mixed files, for each sloot profile, 7-Zip, xz, zpaq and WinRAR

Archive size vs. time to pack 311 MB of mixed files (378 files). All benchmarks on this page were run on an Intel i7-12700KF (12 cores, 20 threads) with 2666 MHz DDR4 RAM, Windows 11.

How it compares

                    sloot   paq8px  cmix   7-Zip  zpaq   RAR    zip
Windows / Linux      W L     W L    W L    W L    W L    W L    W L
Folders, updates      U                     U      U      U      U
Incremental           I                            I      I      I
Deduplication         D                            D
Encryption            E                     E      E      E      E
Recovery record       R                                   R
Multithreading        C                     C      C      C
GUI                   G                     G             G
Unpacks zip/PDF/PNG   P      
Neural network (LSTM)        N      N
Free / open source    F O    F O    F O    F O    F O           F O

Size on disk of each compressor's command line program: xz is the smallest and sloot, at 5.3 MB, the largest

The program itself, Windows 64-bit, command line only (sloot-gui not included).


Benchmarks

Size is the archive size as a percentage of the original. Every sloot archive was extracted and compared with the original files.

Mixed files: 311 MB of text, source code, programs, photos, audio, PDFs and office documents.

sizecompressdecompress
sloot ultra41.2 %21 min21 min
sloot high42.8 %148 s137 s
sloot medium44.9 %73 s59 s
sloot normal47.3 %46 s39 s
sloot fast49.9 %33 s22 s
zpaq -m557.4 %187 s188 s
7-Zip -mx959.8 %28 s2.7 s
xz -9e60.1 %65 s2.4 s
rar -m560.5 %7.2 s0.9 s
sloot fastest62.5 %2.8 s0.7 s
7-Zip -mx162.5 %2.0 s0.7 s
zip -mx964.2 %8.7 s1.4 s

Linux 7.3.4 source: one 1.72 GB tarball.

sizecompressdecompress
sloot ultra4.85 %1.5 h1.5 h
sloot high5.79 %356 s351 s
sloot medium6.63 %150 s132 s
zpaq -m56.68 %415 s414 s
xz -9e8.94 %276 s2.5 s
sloot normal9.00 %34 s16 s
7-Zip -mx99.09 %185 s1.8 s
rar -m5 -md1g9.83 %103 s2.1 s
zip -mx914.66 %1574 s4.4 s

enwik8: the first 100 MB of English Wikipedia.

sizecompressdecompress
cmix v2114.62 MBdaysdays
paq8px15.85 MBdaysdays
sloot ultra16.50 MB322 s322 s
sloot high17.06 MB96 s93 s
zpaq -m519.6 MB104 s105 s
7-Zip PPMd23.2 MB14 s15 s
xz -9e24.8 MB57 s0.7 s

enwik9: the first 1 GB of English Wikipedia.

sizecompressdecompress
cmix v21107.96 MB1 week1 week
paq8px124.70 MB3 days3 days
sloot ultra134.36 MB54 min52 min
sloot high137.27 MB779 s768 s
zpaq (max)142.25 MB--
7-Zip PPMd200.35 MB122 s130 s

cmix and paq8px figures, and zpaq's on enwik9, are published results, not measured here. A dash means no time is given.


Download 🐍

sloot-gui showing the folders and files of an encrypted archive, with size, packed size, ratio, method and date columns

The current version is a beta. Each zip contains sloot (command line) and sloot-gui. There is nothing to install. Any 64-bit x86 CPU works; CPUs with AVX2 (most made since 2015) run faster.

Note: Sloot's code has been thoroughly tested, but not reviewed by a human, including its encryption implementation. Do not rely on it for any important or sensitive data.

Source code and release notes are on GitHub. To build from source, install Rust and run:

cd sloot     && cargo build --release
cd sloot-gui && cargo build --release

sloot is released under the Mozilla Public License 2.0. sloot-gui is released under the MIT license.


How Sloot Works

Most of the speed work in sloot comes from compressing smarter, not harder. Data goes through many steps before it's even compressed:

  1. Unwrapping. A lot of files are already compressed. zip, docx and xlsx, png, pdf... A normal archiver can't compress these any further. Sloot decompresses them, compresses the contents with its own model, and stores only what it needs to rebuild the original file bit for bit.
  2. Deduplicating. Duplicate files are removed. Nested files are handled too, for example a png inside a docx inside a zip won't be stored twice.
  3. Deriving. Data that can be computed from the rest of the file is removed. File hashes, headers, git pack indexes - can all be tossed and recomputed when unpacking. Sloot can intelligently derive and model data from many different data types: everything from documents, raw photos, python bytecode, truetype/opentype fonts, minecraft saves, adobe projects, tcpdump logs, cd-rom error correction codes... most common formats are covered.
  4. Transforming. Data is converted to a form that is easier to model. For example, in x86 code, relative call and jump addresses are converted to absolute, so repeated calls to the same function look the same. Large text is coded with a word dictionary.

Only then comes compression: The fast profiles uses PPMd/BWT/LZMA (whichever is best), which replaces repeated strings with pointers to an earlier copy. The slower profiles use context mixing. The data is coded one bit at a time. For each bit, a set of models predicts the probability that it is a 1. Each model looks at a different context: the previous bytes, the current word, the column in a table, the pixels above and to the left, and so on. A mixer, a small neural network, combines these predictions, giving more weight to models that have recently been right. An arithmetic coder then codes the bit using the final probability, so a confident, correctly predicted bit costs much less than one bit to store.

However, this process is slow and single threaded because every bit's prediction depends on the bit before. The obvious move is to cut the file into pieces and give them their own mixers on every core, but then each piece starts out knowing nothing, and it hurts your ratio.

To get around that, Sloot warms up one model up on the first stretch and then hands copies of itself to other workers. When the memory becomes too big to copy, the workers share a frozen "trunk" and write only into small private overlays. They occasionally share what they learn and can search each other's data for matches.

The profiles differ in how many models they run. fast and normal use a few contexts per data type, medium and high use more, and ultra uses about 60 contexts per bit, two mixer layers and a final correction stage (SSE).

Sloot also saves time by working less.

Limitations