Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle null chunk type using enum value #83

Merged
merged 1 commit into from
Jan 6, 2024
Merged

Conversation

brantburnett
Copy link
Owner

Motivation

Trying to narrow down perf loss in .NET 8 compared to .NET 6 specific to stream decompression.

Modifications

Rather than using a Nullable<ChunkType> to track when the chunk type is unknown, add an enum value that represents null.

Results

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-AODULB : .NET Framework 4.8.1 (4.8.9181.0), X64 RyuJIT VectorSize=256
Job-AZPVRO : .NET Framework 4.8.1 (4.8.9181.0), X64 RyuJIT VectorSize=256
Job-FTJSLO : .NET 6.0.25 (6.0.2523.51912), X64 RyuJIT AVX2
Job-XMQQAK : .NET 6.0.25 (6.0.2523.51912), X64 RyuJIT AVX2
Job-IPTUCK : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
Job-YAGJLP : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
Job-DJZUQL : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
Job-FFPERJ : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2

Method Runtime BuildConfiguration PGO ReadSize Mean Error StdDev Ratio Rank
Decompress .NET Framework 4.8 Previous N 16384 340.4 us 2.56 us 2.39 us 1.00 2
Decompress .NET Framework 4.8 Default N 16384 332.2 us 2.64 us 2.34 us 0.98 1
Decompress .NET 6.0 Previous N 16384 167.5 us 1.11 us 1.04 us 1.00 1
Decompress .NET 6.0 Default N 16384 167.5 us 2.44 us 2.16 us 1.00 1
Decompress .NET 8.0 Previous N 16384 200.7 us 1.19 us 1.06 us 1.00 2
Decompress .NET 8.0 Default N 16384 191.7 us 1.47 us 1.30 us 0.96 1
Decompress .NET 8.0 Previous Y 16384 199.1 us 0.94 us 0.88 us 1.00 2
Decompress .NET 8.0 Default Y 16384 189.9 us 0.91 us 0.85 us 0.95 1

Note: Benchmarks include other improvements since 1.1.3

Motivation
----------
Trying to narrow down perf loss in .NET 8 compared to .NET 6 specific
to stream decompression.

Modifications
-------------
Rather than using a `Nullable<ChunkType>` to track when the chunk type
is unknown, add an enum value that represents null.

Results
-------
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-AODULB : .NET Framework 4.8.1 (4.8.9181.0), X64 RyuJIT VectorSize=256
  Job-AZPVRO : .NET Framework 4.8.1 (4.8.9181.0), X64 RyuJIT VectorSize=256
  Job-FTJSLO : .NET 6.0.25 (6.0.2523.51912), X64 RyuJIT AVX2
  Job-XMQQAK : .NET 6.0.25 (6.0.2523.51912), X64 RyuJIT AVX2
  Job-IPTUCK : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
  Job-YAGJLP : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
  Job-DJZUQL : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2
  Job-FFPERJ : .NET 8.0.0 (8.0.23.53103), X64 RyuJIT AVX2

| Method     | Runtime            | BuildConfiguration | PGO | ReadSize | Mean     | Error   | StdDev  | Ratio | Rank |
|----------- |------------------- |------------------- |---- |--------- |---------:|--------:|--------:|------:|-----:|
| Decompress | .NET Framework 4.8 | Previous           | N   | 16384    | 340.4 us | 2.56 us | 2.39 us |  1.00 |    2 |
| Decompress | .NET Framework 4.8 | Default            | N   | 16384    | 332.2 us | 2.64 us | 2.34 us |  0.98 |    1 |
|            |                    |                    |     |          |          |         |         |       |      |
| Decompress | .NET 6.0           | Previous           | N   | 16384    | 167.5 us | 1.11 us | 1.04 us |  1.00 |    1 |
| Decompress | .NET 6.0           | Default            | N   | 16384    | 167.5 us | 2.44 us | 2.16 us |  1.00 |    1 |
|            |                    |                    |     |          |          |         |         |       |      |
| Decompress | .NET 8.0           | Previous           | N   | 16384    | 200.7 us | 1.19 us | 1.06 us |  1.00 |    2 |
| Decompress | .NET 8.0           | Default            | N   | 16384    | 191.7 us | 1.47 us | 1.30 us |  0.96 |    1 |
|            |                    |                    |     |          |          |         |         |       |      |
| Decompress | .NET 8.0           | Previous           | Y   | 16384    | 199.1 us | 0.94 us | 0.88 us |  1.00 |    2 |
| Decompress | .NET 8.0           | Default            | Y   | 16384    | 189.9 us | 0.91 us | 0.85 us |  0.95 |    1 |

Note: Benchmarks include other improvements since 1.1.3
@brantburnett brantburnett merged commit 9d07b42 into main Jan 6, 2024
30 checks passed
@brantburnett brantburnett deleted the null-chunk-type branch January 6, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant