Performance regressions found in Brotli v1.1.0
- Dominant language
- TypeScript
- Stars
- 14.9k
- Forks
- 1.4k
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 9
Description
The [dotnet/runtime](https://github.com/dotnet/runtime) repo recently [updated](https://github.com/dotnet/runtime/pull/107102/files) its in-tree copy of its Brotli dependency from [v1.0.9](https://github.com/google/brotli/releases/tag/v1.0.9) to [v1.1.0](https://github.com/google/brotli/releases/tag/v1.1.0).
We ran our performance benchmarks, and we noticed regressions in [Linux-x64](https://github.com/dotnet/perf-autofiling-issues/issues/40587) and [Windows-x64](https://github.com/dotnet/runtime/issues/107302).
Most of our regression results were under **15%**, but 6 results were between **39%** an **49%**.
Here's a list of the tests that showed regressions:
#### Windows x64
- 49% - Decompress_WithState(level: Fastest, file: "TestDocument.pdf")
- 47% - Decompress_WithState(level: Optimal, file: "TestDocument.pdf")
- 47% - Decompress_WithoutState(level: Fastest, file: "TestDocument.pdf")
- 47% - Decompress_WithoutState(level: Optimal, file: "TestDocument.pdf")
- 39% - Decompress(level: Fastest, file: "TestDocument.pdf")
- 39% - Decompress(level: Optimal, file: "TestDocument.pdf")
- 13% - Decompress_WithoutState(level: Fastest, file: "alice29.txt")
- 12% - Decompress_WithoutState(level: Optimal, file: "alice29.txt")
- 12% - Decompress_WithState(level: Fastest, file: "alice29.txt")
- 11% - Decompress_WithState(level: Optimal, file: "alice29.txt")
- 11% - Decompress(level: Fastest, file: "alice29.txt")
- 10% - Decompress(level: Optimal: file: "alice29.txt")
- 10% - Decompress_WithState(level: Fastest, file: "sum")
- 10% - Decompress_WithoutState(level: Fastest, file: "sum")
- 09% - Decompress(level: Fastest, file: "sum")
#### Linux x64
- 16% - Compress_WithoutState(level: Optimal, file: "TestDocument.pdf")
- 16% - Compress_WithState(level: Optimal, file: "TestDocument.pdf")
- 15% - Compress_WithoutState(level: Optimal, file: "alice29.txt")
- 15% - Compress_WithoutState(level: Optimal, file: "sum")
- 14% - Compress_WithState(level: Optimal, file: "sum")
- 13% - Compress_WithState(level: Optimal, file: "alice29.txt")
Some more info:
- Our benchmark methods can be found [here](https://github.com/dotnet/performance/blob/main/src/benchmarks/micro/libraries/System.IO.Compression/Brotli.cs
Files tested: https://github.com/dotnet/performance/tree/main/src/benchmarks/micro/libraries/System.IO.Compression/TestData).
- Our in-tree copy of Brotli v1.1.0 is found [here](https://github.com/dotnet/runtime/tree/release/9.0/src/native/external/brotli).
- The managed code that consumes the in-tree copy of Brotli can be found [here](https://github.com/dotnet/runtime/tree/release/9.0/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression).
- [These](https://github.com/dotnet/runtime/blob/a95d038411e80f07b5ef1264cc8425f55fbc5ec9/src/libraries/System.IO.Compression.Brotli/src/System/IO/Compression/BrotliUtils.cs) are the mappings of the `CompressionLevel` enum to Brotli quality values:
- "Fastest" => 1
- "Optimal" => 4:
Unfortunately, the [v1.1.0 tag](https://github.com/google/brotli/releases/tag/v1.1.0) has no mention of known perf regressions, so we were wondering if you were aware of these results and if you could help us figure out the possible root causes.
Contributor guide
Assessment
This issue has not been assessed yet.