Optimal 7-Zip Thread Count for Hyper-Threading

When compressing archives in 7-Zip on a system with a hyper-threaded (or SMT-enabled) processor, setting the thread count to match your CPU's physical core count rather than its total logical thread count generally yields the fastest and most efficient performance. While hyper-threading improves multi-tasking in many workloads, heavy compression algorithms like LZMA and LZMA2 quickly saturate CPU caches and memory bandwidth, causing logical threads to compete for resources and introduce performance penalties.

The Recommendation: Match Physical Cores

For the majority of compression tasks using LZMA or LZMA2, set the CPU threads parameter in 7-Zip to the number of physical cores your processor possesses (for example, 8 threads on an 8-core / 16-thread CPU).

Although 7-Zip defaults to using all available logical threads, running full hyper-threading often results in diminishing returns or slower overall compression times.

Why Hyper-Threading Degrades Heavy Compression

  1. Shared Execution Resources: Hyper-Threading (Intel) and Simultaneous Multi-Threading (AMD) do not double physical processing power; they duplicate architectural state registers to keep an execution pipeline full. LZMA compression relies heavily on integer math and continuous pipeline utilization, leaving very few idle execution cycles for a second logical thread on the same physical core to exploit.
  2. Cache Contention: Each compression thread requires substantial L2 and L3 CPU cache. Running two threads per physical core forces both to share the same cache capacity, causing severe cache thrashing and memory latency spikes.
  3. Memory Bandwidth Bottlenecks: LZMA/LZMA2 is extremely memory-intensive. Doubling the active threads to match logical counts saturates the system memory controller, meaning cores spend more time waiting for RAM access rather than crunching data.

Impact on RAM Consumption

Every active compression thread in 7-Zip requires a dedicated memory buffer proportional to the selected dictionary size:

  • Memory Usage Formula: Approximately Threads × (Dictionary Size × 10) for standard LZMA2 compression.

If you have a 16-thread CPU and choose a 64 MB dictionary, setting threads to 16 requires roughly 10 GB of RAM. Limiting the setting to 8 physical cores cuts that footprint in half (roughly 5 GB) without sacrificing speed, preventing the operating system from swapping data to the pagefile on systems with limited memory.

When Can You Use More Threads?

Using all logical threads can be viable under specific conditions:

  • Light Compression Levels: If you use "Store," "Fastest," or "Fast," CPU utilization is lower, and threads finish jobs quickly without exhausting cache limits.
  • Alternative Algorithms: Lighter algorithms like Deflate or BZip2 experience less cache contention than LZMA2 and may see minor improvements from logical threading.

How to Apply the Setting in 7-Zip

  1. Open 7-Zip and select the files you want to compress.
  2. Click Add to open the Add to Archive window.
  3. Locate the CPU threads dropdown on the right side.
  4. Select the number corresponding to your processor's physical core count instead of the default maximum value.
  5. Click OK to begin compression.