Skip to content

GZipStream regression - Much worse compression for sparse data when specifying CompressionLevel.Optimal #28235

@SeanFeldman

Description

@SeanFeldman

Expected behaviour

To produce identical compressed result for the same original byte array on .NET Framework and .NET Core.

Actual behaviour

Results of GZipStream on .NET Framework and .NET Core are different.

Repro

  1. An array of 1500 characters 'A'
  2. Compressed using GZipStream
  3. Verified results on .NET Framework (4.6.1) and .NET Core (2.1) that should be identical, but they are not.

Code available here.

Results

Platform Compressed result in hexa
.NET Framework
4.6.1
1f8b080000000000040073741c05a360148c825130dc00004d6f6cebdc050000
.NET Core 2.2.100
Commit b9f2fa0ca8

Host 2.2.0 Commit 1249f08fed
1f8b080000000000000b73741c05a321301a02a321301a028ec30c00004d6f6cebdc050000

Executed on Windows 10 Pro 64bit 1809 build 17763.134

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions