From a460c9e7653b2fde6f40c0a5336a695ba52ffa87 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Mon, 13 Jan 2014 00:30:50 -0600 Subject: [PATCH] write_stream_list(): Do not create threads to compress 1 chunk or less --- src/write.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/write.c b/src/write.c index a852c199..63350bfc 100644 --- a/src/write.c +++ b/src/write.c @@ -1430,11 +1430,11 @@ write_stream_list(struct list_head *stream_list, * to do compression. There are serial and parallel implementations of * the chunk_compressor interface. We default to parallel using the * specified number of threads, unless the upper bound on the number - * bytes needing to be compressed is less 2000000 (heuristic value). */ + * bytes needing to be compressed is less than a heuristic value. */ if (out_ctype != WIMLIB_COMPRESSION_TYPE_NONE) { #ifdef ENABLE_MULTITHREADED_COMPRESSION - if (ctx.num_bytes_to_compress >= 2000000) { + if (ctx.num_bytes_to_compress > max(2000000, out_chunk_size)) { ret = new_parallel_chunk_compressor(out_ctype, out_chunk_size, num_threads, 0, -- 2.43.0