7-Zip CLI Parameter for LZMA Word Size

This article explains the specific parameter used to configure the match finder word size in the 7-Zip Command Line Interface (CLI) when using LZMA or LZMA2 algorithms. It covers the parameter syntax, supported numerical ranges, default configurations, and practical usage examples to help you optimize compression ratios and processing speed.

The Word Size Parameter: fb

In the 7-Zip CLI, the parameter used to define the word size for the match finder is fb (short for "fast bytes"). When configured via the command line, it can be passed either directly as -mfb or as an attribute within a method assignment (such as -m0=lzma2:fb).

The word size represents the maximum number of bytes the LZMA match finder evaluates when searching for identical sequences of data. In the 7-Zip graphical interface, this setting is labeled directly as "Word size."

Syntax and Usage

You can set the word size using either of the following formats:

  1. Direct method flag:

    7z a archive.7z file.txt -mfb=64
  2. Explicit method definition:

    7z a archive.7z file.txt -m0=lzma2:fb=64

Value Ranges and Defaults

  • Allowed Range: The value for fb ranges from 5 to 273.
  • Default Values:
    • Normal compression (-mx=5): 32
    • Maximum compression (-mx=7): 64
    • Ultra compression (-mx=9): 64 (often adjusted manually to 128 or 273)

Impact on Compression and Performance

  • Higher values (up to 273): Allow the match finder to detect longer duplicate patterns. This can yield better compression ratios on files with large blocks of repetitive data (such as binary files or databases), but it significantly increases compression time.
  • Lower values (down to 5): Drastically reduce compression time by limiting deep matching passes, at the expense of a lower compression ratio.
  • Decompression: Adjusting fb only affects compression time and does not increase RAM usage during decompression or noticeably impact decompression speed.