-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Milestone
Description
The newly added compression algorithm Brotli as tracked by #23936 defaults to quality 11 as seen here:
https://github.com/dotnet/corefx/blob/8f9cfa462dfc2ec5bdbbe2462693036861fb0199/src/System.IO.Compression.Brotli/src/System/IO/Compression/BrotliUtils.cs#L13
From a quick look at Brotli's code (https://github.com/google/brotli), it seems level 5 and 6 is intended for optimal ratio/speed and the Brotli team seems to tweak the algorithm to make sure it is the case.
I tested against a 518,461,845 byte file I use for compression benchmarks.
- With Brotli and CompressionLevel.Optimal (quality = 11 | goes from 0 to 11) it takes ~14 minutes to compress.
- With Deflate and CompressionLevel.Optimal (quality = 6 | goes from 0 to 9) it takes ~6 seconds to compress.
It seems that defaulting to 11 makes the algorithm very slow for the common case.