Squinch usage

squinch compresses and decompresses Squinch streams. unsquinch is a decompression-only command.

Usage

squinch c <window> [options] <input-file|-> <output-file|->
squinch d [options] <input-file|-> <output-file|->
unsquinch [options] <input-file|-> <output-file|->

compress and decompress may be used instead of c and d.

Operations

compress, c compresses the input.

decompress, d decompresses the input.

Options

-h, -help, and --help show the help page.

--version prints the program version. It must be the only argument.

--match-limit <count> is available only for compression. It sets how many match candidates the compressor examines: 1 through 512, default 128. Higher values can reduce file size but slow compression; lower values do the reverse. It does not affect memory or decompression directly. In the benchmarks, 1 was up to 7 times faster but made files up to 39% larger; 512 saved at most 0.8% but took up to 2.3 times as long.

--buckets <count> is available only for compression. It sets the number of hash buckets for match candidates: at least 1024, default 65536. More buckets can improve compression speed and ratio, but use more memory; fewer use less memory but are usually slower and can make files slightly larger. The bucket table uses count * sizeof(size_t) bytes: 512 kiB for 65536 buckets with an 8-byte size_t. It does not affect decompression.

--look-ahead <size> is available only for compression. It sets how much input the compressor can inspect before choosing the next token; the default is the window size or 1 kiB, whichever is smaller. Larger values can improve the ratio but use more memory and delay output; smaller values reduce memory and latency but can increase file size. It does not extend the history window or affect decompression. In the benchmarks, 512 bytes increased file size by up to 8.3%, while 4 kiB saved at most 0.8% over 1 kiB. Compression-speed effects depend on the input. Sizes are bytes, kiB, or MiB; suffixes are case insensitive.

--io-buffer-size <size> sets each command-line input and output buffer; the default is 8 kiB. It does not affect compressed data or ratio. Larger buffers can improve compression and decompression speed by reducing I/O overhead, while smaller ones use less memory but can be slower. The two buffers use twice this size: 16 kiB by default. Sizes are bytes, kiB, or MiB; suffixes are case insensitive.

The measurements above use the repository's fixture corpus. See Benchmark.md for the complete results and memory tables.

<window> is 16 through 65536 bytes. Sizes may also be written as 1kiB through 64kiB; the kiB suffix is case insensitive.

Use -- to mark the end of options. This allows paths that begin with -.

Notes

Use - as the input or output file to read from standard input or write to standard output.

The standalone shell implementation in src/unsquinch.sh uses the same syntax, for example:

src/unsquinch.sh - - <input.squinch >output

Size metadata

When compressing a regular seekable input file and the file has less than 1 TiB of data, squinch stores its uncompressed size in the stream header. It stores an unknown size for standard input, non-seekable inputs and files 1 TiB or larger. The encoded-size rules are specified in Format.md.