zstd icon indicating copy to clipboard operation
zstd copied to clipboard

Multithreaded decompression

Open NMinhNguyen opened this issue 5 years ago • 5 comments

Hey, so I tried searching this repo to find out whether zstd supports multithreaded decompression, but was unable to find anything conclusive. I tried using terms like -T0 / multithread / multithreaded alongside decompress / decompression. The reason why I'm unclear on this is because the description for -T uses the term compress but not sure if it also applies to decompression:

https://github.com/facebook/zstd/blob/7e6c53c7fe25e84d0a72224165403f4a786d43fa/programs/zstd.1.md#L115-L119

Perhaps if this is only limited to compression, the docs could be updated to indicate so?

NMinhNguyen avatar Jan 13 '21 17:01 NMinhNguyen

There is currently no multithreading for decompression, only for compression. This is due to a combination of being more difficult to do, and less critical, since decompression is already plenty fast with just a single thread (typically faster than ssd).

This doesn't mean that it is impossible to do, but it will require care and available time to be achieved properly.

Cyan4973 avatar Jan 13 '21 17:01 Cyan4973

Got it, thanks for the prompt reply! I'm happy for this issue to be closed then.

NMinhNguyen avatar Jan 13 '21 17:01 NMinhNguyen

There is currently no multithreading for decompression, only for compression. This is due to a combination of being more difficult to do, and less critical, since decompression is already plenty fast with just a single thread (typically faster than ssd).

This doesn't mean that it is impossible to do, but it will require care and available time to be achieved properly.

@Cyan4973 Any plan to implement multi-threaded decompression in 2025? Single-threaded decompression isn't typically faster than SSD in 2025 now, as PCIe 4.0 SSDs are increasingly prevalent (7000 MiB/s+ Read, 6000 MiB/s+ Write) Several PCIe 5.0 consumer SSDs have released, which are even faster. Take Crucial T700 which was released in 2023 as an example, it has 12,400 MiB/s sequential read speed and 11,800 MiB/s sequential write speed.

Integral-Tech avatar Mar 31 '25 16:03 Integral-Tech

@Cyan4973 Any plan to implement multi-threaded decompression in 2025? Single-threaded decompression isn't typically faster than SSD in 2025 now, as PCIe 4.0 SSDs are increasingly prevalent (7000 MiB/s+ Read, 6000 MiB/s+ Write) Several PCIe 5.0 consumer SSDs have released, which are even faster. Take Crucial T700 which was released in 2023 as an example, it has 12,400 MiB/s sequential read speed and 11,800 MiB/s sequential write speed.

Given this, I'd like to also request this be reconsidered. Preferably with the same env variable of ZSTD_NBTHREADS=0 so we can just default to using it, on an environmental basis.

ScottRosenberg2 avatar Jun 05 '25 17:06 ScottRosenberg2

What about decompressing 500gb+ of data, it will not be fast please add multithreaded decomp

LeakorgX avatar Jul 30 '25 03:07 LeakorgX