Skip to content

Commit

Permalink
Increase penalty a bit to avoid speed regression.
Browse files Browse the repository at this point in the history
  • Loading branch information
klauspost committed Jan 16, 2020
1 parent 4c57fdd commit 9ff01f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flate/deflate.go
Original file line number Diff line number Diff line change
Expand Up @@ -644,15 +644,15 @@ func (d *compressor) init(w io.Writer, level int) (err error) {
d.fill = (*compressor).fillBlock
d.step = (*compressor).store
case level == ConstantCompression:
d.w.logNewTablePenalty = 5
d.w.logNewTablePenalty = 4
d.window = make([]byte, maxStoreBlockSize)
d.fill = (*compressor).fillBlock
d.step = (*compressor).storeHuff
case level == DefaultCompression:
level = 5
fallthrough
case level >= 1 && level <= 6:
d.w.logNewTablePenalty = 7
d.w.logNewTablePenalty = 6
d.fast = newFastEnc(level)
d.window = make([]byte, maxStoreBlockSize)
d.fill = (*compressor).fillBlock
Expand Down

0 comments on commit 9ff01f5

Please sign in to comment.