lbunzip2 — guide
Class:
guide· Function:lbunzip2. Build, run, tune. Shape inlbunzip2-design.md; why inlbunzip2-reasoning.md.
Build
CARGO_TARGET_DIR=/mnt/work4t/cargo-target/zoomies cargo build --release -p lbzip2
Binary lands at target/release/lbunzip2.
Run
lbunzip2 planet.osm.bz2 # → planet.osm (strips .bz2)
lbunzip2 in.bz2 out # explicit output path
Reads anything bzip2 / lbzip2 / pbzip2 wrote (stock format, single-stream or pbzip2-style concatenated). Watch htop: cores should sit near-flat; the block scan is the only serial-ish work and it is itself fanned across cores.
Tune
LBZIP2_THREADS=Npins worker count.LBZIP2_THREADS=1forces the single-worker_stbench row and still streams the whole file (segments are floored at 2, decoded one at a time — see the design's "segmentation floor"). Unset ⇒ physical core count.
Library twins
The CLI is streaming; for in-memory or Read-trait use reach for the library readers (lbzip2::parallel::decompress_parallel, StreamingBz2Read, ParallelBz2Read) — documented in lbzip2-readers-design.md / -guide.
Bench
HEAVY only (no smoke): nornir bench run znippy-zoomies then nornir docs book znippy-zoomies fills the README A/B/C mashup. The _st single-core row (LBZIP2_THREADS=1) races stock serial bzip2; the all-core row races lbzip2/pbzip2. See decompressors-guide.md.