Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve .NET 8 stream decompression perf (#84)
Motivation ---------- .NET 8 has shown a significant regression when decompressing streams, though not blocks. Modifications ------------- Drop some overly aggressive inlining on cold paths, which may provide better enregistration. Also, for .NET 8 use an inline array to avoid allocating the scratch buffer on the heap. Results ------- The regression has been effectively eliminated. BenchmarkDotNet v0.13.10, Windows 11 (10.0.22621.2861/22H2/2022Update/SunValley2) 12th Gen Intel Core i7-1270P, 1 CPU, 16 logical and 12 physical cores .NET SDK 8.0.100 [Host] : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2 Job-EHUKKX : .NET Framework 4.8.1 (4.8.9181.0), X64 RyuJIT VectorSize=256 Job-SIHOZS : .NET Framework 4.8.1 (4.8.9181.0), X64 RyuJIT VectorSize=256 Job-VAGBBP : .NET 6.0.25 (6.0.2523.51912), X64 RyuJIT AVX2 Job-ZACCID : .NET 6.0.25 (6.0.2523.51912), X64 RyuJIT AVX2 Job-ACXPKE : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2 Job-JFCQYT : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2 Job-CWWXAC : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2 Job-IDGNPX : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2 | Method | Runtime | BuildConfiguration | PGO | Mean | Error | StdDev | Ratio | Rank | |----------- |------------------- |------------------- |---- |---------:|--------:|--------:|------:|-----:| | Decompress | .NET Framework 4.8 | Previous | N | 342.7 us | 1.73 us | 1.45 us | 1.00 | 2 | | Decompress | .NET Framework 4.8 | Default | N | 334.7 us | 0.85 us | 0.80 us | 0.98 | 1 | | | | | | | | | | | | Decompress | .NET 6.0 | Previous | N | 168.5 us | 1.43 us | 1.34 us | 1.00 | 2 | | Decompress | .NET 6.0 | Default | N | 164.8 us | 0.78 us | 0.73 us | 0.98 | 1 | | | | | | | | | | | | Decompress | .NET 8.0 | Previous | N | 199.9 us | 1.64 us | 1.53 us | 1.00 | 2 | | Decompress | .NET 8.0 | Default | N | 160.7 us | 1.42 us | 1.33 us | 0.80 | 1 | | | | | | | | | | | | Decompress | .NET 8.0 | Previous | Y | 191.3 us | 1.05 us | 0.98 us | 1.00 | 2 | | Decompress | .NET 8.0 | Default | Y | 160.9 us | 1.50 us | 1.40 us | 0.84 | 1 | Note: Benchmarks include other improvements since 1.1.3
- Loading branch information