From: Eric Biggers Date: Mon, 13 Jan 2014 06:30:50 +0000 (-0600) Subject: write_stream_list(): Do not create threads to compress 1 chunk or less X-Git-Tag: v1.6.1~57 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=a460c9e7653b2fde6f40c0a5336a695ba52ffa87;ds=sidebyside write_stream_list(): Do not create threads to compress 1 chunk or less --- 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,