How 7-Zip Measures Compression Speed in MB/s
This article explains how the 7-Zip archiving utility calculates and displays compression throughput in megabytes per second (MB/s). It covers the mathematical ratio used to determine processing speed, the role of uncompressed source data in the calculation, the influence of multi-threading, and how MB/s throughput differs from the Millions of Instructions Per Second (MIPS) rating displayed in 7-Zip benchmarks.
The Core Throughput Formula
7-Zip measures compression speed by tracking the volume of raw, uncompressed input data processed over a specific period of time. Rather than measuring the size of the resulting compressed archive, the metric focuses strictly on the speed at which the compression engine ingests and encodes source data.
The throughput value is calculated using a standard rate formula:
\[\text{Speed (MB/s)} = \frac{\text{Uncompressed Data Processed (in Megabytes)}}{\text{Elapsed Time (in Seconds)}}\]
In 7-Zip's user interface, measurements historically use binary megabytes (mebibytes, where \(1\text{ MB} = 1,048,576\text{ bytes}\)), meaning the rate reflects \(2^{20}\) bytes per second rather than the decimal equivalent (\(10^6\) bytes).
Source Data Size vs. Output Size
A common point of confusion is whether the megabytes per second figure reflects the rate of writing compressed data to the disk or reading the source files. 7-Zip calculates throughput using the original uncompressed stream.
For example, if 7-Zip processes an uncompressed 100 MB file in 2 seconds and reduces it to a 20 MB archive, the recorded speed is 50 MB/s (100 MB divided by 2 seconds), not 10 MB/s. This allows users to understand how quickly 7-Zip can work through a queue of files regardless of the resulting compression ratio.
Time Measurement and Multi-Threading
When calculating throughput, 7-Zip factors in real-world wall-clock time alongside CPU core utilization:
- Wall-Clock Time: For overall task throughput (such
as creating an actual
.7zarchive), the progress window calculates speed based on total elapsed real time from the start of the job to the current moment. - Multi-Threading Effects: When multi-threading is enabled (e.g., across 8 or 16 threads), 7-Zip splits the incoming data streams into blocks or uses multi-threaded match finders. The MB/s figure reflects the aggregate amount of data all threads processed simultaneously within that elapsed real-time window. As a result, adding threads increases the MB/s value proportionally until hardware bottlenecks (such as RAM bandwidth or cache limits) are reached.
The Built-in Benchmark: MB/s vs. MIPS
7-Zip includes a dedicated benchmarking tool (Tools >
Benchmark or command line 7z b) that
explicitly tests compression and decompression performance using the
LZMA algorithm.
The benchmark produces two primary metrics:
- Speed (KB/s or MB/s): The actual throughput of data processed per second using fixed dictionary sizes (such as 32 MB) generated directly in RAM. This removes storage drive bottlenecks and isolates the raw processing speed of the CPU and memory subsystem.
- Rating (MIPS): Millions of Instructions Per Second. 7-Zip converts the measured throughput (MB/s) into an estimated MIPS rating based on an internal calibration algorithm. The benchmark algorithm defines a baseline instruction cost for compressing a specific sequence of data; it multiplies the processed MB/s by this predetermined complexity constant to estimate computational power independent of raw data size.