How 7-Zip Benchmark Measures CPU Performance in MIPS
The built-in benchmark in 7-Zip evaluates processor capability by measuring the speed of data compression and decompression tasks and translating those results into Millions of Instructions Per Second (MIPS). This article explains the mechanics behind 7-Zip's benchmarking tool, how it calculates MIPS values for both compression and decompression, and what architectural factors influence these scores.
Understanding MIPS in the Context of 7-Zip
In general computing, MIPS (Million Instructions Per Second) measures raw instruction execution frequency, but 7-Zip treats MIPS as a normalized, algorithm-specific metric. Rather than polling hardware performance counters directly, 7-Zip assigns a fixed, standardized instruction cost to the mathematical steps required by the LZMA (Lempel-Ziv-Markov chain algorithm) engine.
The benchmark calculates MIPS using the following general formula:
\[\text{MIPS} = \frac{\text{Processed Data Size} \times \text{Instructions per Byte}}{\text{Elapsed Time} \times 10^6}\]
By using a fixed ratio of reference instructions per byte of processed data, the reported MIPS directly reflects the throughput (megabytes per second) achieved by the processor under test.
Measuring Compression Performance
Compression in LZMA is primarily an algorithmic search for matching bit patterns across a sliding dictionary window, followed by range encoding.
- Workload Characteristics: Compression involves intensive memory access, random lookups in hash chains or binary trees, and extensive branch evaluation. It relies heavily on low-latency L1/L2/L3 CPU cache, high memory bandwidth, and competent branch prediction.
- MIPS Calculation: The benchmark processes a predefined data pattern using a selected dictionary size (typically 32 MB by default). Because searching for match patterns requires significantly more compute cycles per byte than reconstructing them, the reference instruction multiplier for compression is relatively high. The benchmark logs the wall-clock time required to compress the block, applies the fixed complexity factor, and divides by the elapsed time to yield the Compression MIPS rating.
Measuring Decompression Performance
Decompression requires reading the encoded stream and reconstructing the original data using a simple byte-copying process combined with range decoding arithmetic.
- Workload Characteristics: Unlike compression, decompression does not perform dictionary searches or hash table lookups. The process is almost entirely compute-bound, dependent on integer pipeline speed, arithmetic logic unit (ALU) efficiency, and instruction-level parallelism. It demands very little cache or memory bandwidth compared to compression.
- MIPS Calculation: Because decompression requires far fewer operations per byte, 7-Zip uses a different reference instruction multiplier specifically calibrated to LZMA decoding routines. The benchmark measures how rapidly the processor unpacks the data and calculates the Decompression MIPS based on that throughput.
The Resulting Metrics: Usage and Rating
When the benchmark finishes, 7-Zip presents several key metrics:
- Current/Resulting Rating: The actual performance achieved by the system, expressed in MIPS, derived from throughput.
- CPU Usage: The percentage of total CPU capacity utilized during the run, showing how effectively the multi-threaded LZMA implementation scales across available physical and logical cores.
- Rating / Usage: A normalized score that divides the MIPS rating by the CPU usage percentage. This metric indicates single-core efficiency and instructions-per-clock (IPC) execution regardless of core count.
Because compression stresses memory subsystems and decompression stresses raw integer execution, comparing the two separate MIPS figures provides insight into where a CPU architecture excels or encounters bottlenecks.