borg-benchmark-cpu(1)

✨ borg-benchmark-cpu ✨

okay bestie, welcome to the borg backup tool manual β€” this one's all about borg-benchmark-cpu, aka the page that tells you how to make your CPU sweat on purpose. πŸ’…


🌸 NAME 🌸

borg-benchmark-cpu β€” Benchmark CPU-bound operations.


πŸŽ€ SYNOPSIS πŸŽ€

borg [common options] benchmark cpu [options]

πŸ¦‹ DESCRIPTION πŸ¦‹

so this command benchmarks, like, miscellaneous CPU-bound Borg operations. it's the little stress test that could. 🫢

here's the vibe: it creates input data in memory, runs the operation, and then shows you the throughput. that's it, that's the whole thing.

but listen β€” if you want your timings to actually mean something, you gotta run this on:

  • a machine that's as idle as possible otherwise (no other chaos happening, pls)
  • a machine with enough free memory so nothing slows down from paging activity 😭

which benchmarks run? 🌈

by default, all of them run. if you want just a few, hand it one or more of --chunking, --hashing, --encrypting, --compressing, --msgpacking and only those will run. pick your faves. πŸ‘‘

the multi-buffer-size thing 🧚

some algorithms only spin up multiple threads once you're above a size threshold, so the hashes and the compressors get measured at more than one buffer size:

  • the hashes at 64MiB (roughly pack-sized) and 2MiB (a typical borg chunk) β€” both of those are above blake3's threshold
  • the compressors at 2MiB and 128kiB, which is below zstd's threshold

and within a section, every single row processes the same total number of bytes β€” 1 GiB, or 10 MiB for the compressors (or the complete given data when you're using --data) β€” so the throughput column is actually comparable between rows. no sneaky apples-to-oranges. πŸ“

synthetic data tea β˜•

by default the compressors work on synthetic text-like data that compresses about 4x at zstd,3.

and ngl, why not random data? because random data would be the worst possible input πŸ’€ β€” no codec can compress it, so all of them would take their incompressible fast path and the levels would barely differ. boring AND misleading. we don't do that here.

bring your own data πŸ“

synthetic data can still behave differently from your real data, so the compression benchmarks can instead run on data you provide with --data PATH:

  • PATH is a file or a directory
  • if it's a directory, all files below it are read and concatenated, up to 1 GiB
  • the complete data is compressed: it gets cut into consecutive buffers of the measured sizes (a partial buffer at the end is skipped), so ratios and throughput reflect all of it, and the runtime scales with its size

public benchmark corpora β€” like the Silesia corpus or the Canterbury corpus β€” make good reproducible inputs that resemble real-world data. just download and unpack them first, then point --data at the result. iykyk. ✨

ratios, bestie πŸ“Š

the compression rows also show you the achieved compression ratio, which is:

uncompressed size / compressed size

higher is better. periodt. πŸ‘‘


πŸ’… OPTIONS πŸ’…

see borg-common(1) for the common options of Borg commands.

🌟 options 🌟

  • --json β€” format output as JSON
  • --chunking β€” benchmark the chunkers
  • --hashing β€” benchmark the hashes / MACs
  • --encrypting β€” benchmark the encryption modes
  • --compressing β€” benchmark the compressors
  • --data PATH β€” benchmark the compressors with the data from this file or directory (default: synthetic data)
  • --msgpacking β€” benchmark msgpack item packing

πŸ”₯ SEE ALSO πŸ”₯


πŸ‘‘ AUTHOR πŸ‘‘

The Borg Collective


okay that's the whole page, bestie β€” slay πŸ’– this was borg-benchmark-cpu(1) from the borg backup tool, dated 2026-10-07. go make that CPU work for its money. πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from