Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Merge pull request #5458 from ianhays/compressionPerf
Browse files Browse the repository at this point in the history
System.IO.Compression: Make the ZLib BestCompression 6
  • Loading branch information
Ian Hays committed Jan 15, 2016
2 parents 3ac53f5 + eaafda0 commit 78ad63e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Native/System.IO.Compression.Native/pal_zlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static_assert(PAL_Z_VERSIONERROR == Z_VERSION_ERROR, "");

static_assert(PAL_Z_NOCOMPRESSION == Z_NO_COMPRESSION, "");
static_assert(PAL_Z_BESTSPEED == Z_BEST_SPEED, "");
static_assert(PAL_Z_BESTCOMPRESSION == Z_BEST_COMPRESSION, "");
static_assert(PAL_Z_DEFAULTCOMPRESSION == Z_DEFAULT_COMPRESSION, "");

static_assert(PAL_Z_DEFAULTSTRATEGY == Z_DEFAULT_STRATEGY, "");

Expand Down
2 changes: 1 addition & 1 deletion src/Native/System.IO.Compression.Native/pal_zlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum PAL_CompressionLevel : int32_t
{
PAL_Z_NOCOMPRESSION = 0,
PAL_Z_BESTSPEED = 1,
PAL_Z_BESTCOMPRESSION = 9,
PAL_Z_DEFAULTCOMPRESSION = -1,
};

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal Deflater(CompressionLevel compressionLevel, int windowBits)
// See the note in ZLibNative.CompressionLevel for the recommended combinations.

case CompressionLevel.Optimal:
zlibCompressionLevel = ZLibNative.CompressionLevel.BestCompression;
zlibCompressionLevel = ZLibNative.CompressionLevel.DefaultCompression;
memLevel = ZLibNative.Deflate_DefaultMemLevel;
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ public enum ErrorCode : int
///
/// <p><strong>How to choose a compression level:</strong></p>
///
/// <p>The names <code>NoCompression</code>, <code>BestSpeed</code>, <code>BestCompression</code> are taken over from the corresponding
/// <p>The names <code>NoCompression</code>, <code>BestSpeed</code>, <code>DefaultCompression</code> are taken over from the corresponding
/// ZLib definitions, which map to our public NoCompression, Fastest, and Optimal respectively.
/// <p><em>Optimal Compression:</em></p>
/// <p><code>ZLibNative.CompressionLevel compressionLevel = ZLibNative.CompressionLevel.BestCompression;</code> <br />
/// <p><code>ZLibNative.CompressionLevel compressionLevel = ZLibNative.CompressionLevel.DefaultCompression;</code> <br />
/// <code>Int32 windowBits = 15; // or -15 if no headers required</code> <br />
/// <code>Int32 memLevel = 8;</code> <br />
/// <code>ZLibNative.CompressionStrategy strategy = ZLibNative.CompressionStrategy.DefaultStrategy;</code> </p>
Expand All @@ -72,7 +72,7 @@ public enum CompressionLevel : int
{
NoCompression = 0,
BestSpeed = 1,
BestCompression = 9, // Refer to "How to choose a compression level" above.
DefaultCompression = -1
}

/// <summary>
Expand Down

0 comments on commit 78ad63e

Please sign in to comment.