Benchmark System Performance with 7-Zip Command Line

The 7-Zip command line tool features a built-in benchmarking utility that measures CPU performance and memory stability by running LZMA compression and decompression algorithms. This guide explains how to execute the 7-Zip benchmark from your terminal, customize parameters such as CPU threads and dictionary sizes, and interpret the resulting MIPS (Million Instructions Per Second) scores to evaluate your system's processing capabilities.

Prerequisites

Ensure you have 7-Zip installed and accessible from your terminal or command prompt:

  • Windows: Use 7z.exe located in the installation folder (e.g., C:\Program Files\7-Zip), or add the folder to your system's PATH.
  • Linux / macOS: Install the package using your distribution's package manager (e.g., sudo apt install p7zip-full or brew install sevenzip) and run the 7z or 7za command.

Running the Default Benchmark

To run a standard benchmark across all detected CPU threads using the default 32 MB dictionary size, open your command-line interface and enter:

7z b

The tool will execute multiple passes of compression and decompression, updating the console in real time until it completes the default number of iterations. To cancel the test at any time, press Ctrl + C.

Understanding the Results

When the test finishes, 7-Zip displays a summary table with the following key metrics:

  • Speed: The throughput of data processed, measured in kilobytes per second (KB/s).
  • Usage: The percentage of CPU resources utilized during the test (e.g., 800% indicates 8 CPU threads running at full capacity).
  • R / U (Rating / Usage): The efficiency rating normalized per single core/thread.
  • Rating: The overall performance score expressed in MIPS (Million Instructions Per Second). Higher ratings indicate faster CPU performance.

The output distinguishes between two stages:

  1. Compressing: Highly dependent on CPU cache, memory latency, and RAM speed.
  2. Decompressing: Highly dependent on pure integer processing power and branch prediction within the CPU.

Customizing Benchmark Parameters

You can modify how the benchmark runs by appending specific arguments to the 7z b command.

1. Adjusting CPU Threads (-mmt)

By default, 7-Zip utilizes all available CPU cores and threads. To test single-core performance or limit thread usage, use the -mmt switch:

  • Single-core test:
    7z b -mmt=1
  • Specific thread count (e.g., 4 threads):
    7z b -mmt=4

2. Changing the Dictionary Size (-md)

Changing the dictionary size tests different amounts of RAM and cache hierarchy. The format is -md={Size}[m|g]:

  • Test with a 64 MB dictionary:
    7z b -md=64m
  • Test with a 256 MB dictionary (requires more RAM):
    7z b -md=256m

3. Setting the Number of Iterations

You can specify the number of benchmark passes by providing an integer after the b command. This is useful for short tests or sustained stress testing:

  • Run exactly 10 passes:
    7z b 10
  • Run a stress test with 50 passes across 8 threads:
    7z b 50 -mmt=8