build(deps): bump the github-actions group with 6 updates Bumps the github-actions group with 6 updates: | Package | From | To | | --- | --- | --- | | [actions/checkout](https://github.com/actions/checkout) | `7.0.0` | `7.0.1` | | [github/codeql-action/init](https://github.com/github/codeql-action) | `4.37.3` | `4.37.9` | | [github/codeql-action/autobuild](https://github.com/github/codeql-action) | `4.37.3` | `4.37.9` | | [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.37.3` | `4.37.9` | | [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.4.3` | `2.4.4` | | [github/codeql-action](https://github.com/github/codeql-action) | `4.36.2` | `4.37.9` | Updates `actions/checkout` from 7.0.0 to 7.0.1 - [Release notes](https://github.com/actions/checkout/releases) - [Commits](https://github.com/actions/checkout/compare/v7...v7.0.1) Updates `github/codeql-action/init` from 4.37.3 to 4.37.9 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...cdf488f595d80d6e07e03d4674febd5ab45fa938) Updates `github/codeql-action/autobuild` from 4.37.3 to 4.37.9 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...cdf488f595d80d6e07e03d4674febd5ab45fa938) Updates `github/codeql-action/analyze` from 4.37.3 to 4.37.9 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/e4fba868fa4b1b91e1fdab776edc8cfbe6e9fb81...cdf488f595d80d6e07e03d4674febd5ab45fa938) Updates `ossf/scorecard-action` from 2.4.3 to 2.4.4 - [Release notes](https://github.com/ossf/scorecard-action/releases) - [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md) - [Commits](https://github.com/ossf/scorecard-action/compare/v2.4.3...v2.4.4) Updates `github/codeql-action` from 4.36.2 to 4.37.9 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/v4.36.2...v4.37.9) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: 7.0.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: github/codeql-action/init dependency-version: 4.37.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: github/codeql-action/autobuild dependency-version: 4.37.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: github/codeql-action/analyze dependency-version: 4.37.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: ossf/scorecard-action dependency-version: 2.4.4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: github/codeql-action dependency-version: 4.37.9 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
This package provides various compression algorithms.
github.com/golang/snappy offering better compression and concurrent streams.compress/lzw with 1.4-4x faster decompression and 1.1-2.7x faster compression, depending on the data.Use go get github.com/klauspost/compress@latest to add it to your project.
This package will support the current Go version and 2 versions back.
nounsafe tag to disable all use of the “unsafe” package.noasm tag to disable all assembly across packages.Use the links above for more information on each.
Jul 1st, 2026 1.19.0
decodedLen by @eustas in https://github.com/klauspost/compress/pull/1148Feb 9th, 2026 1.18.4
Jan 16th, 2026 1.18.3
Dec 1st, 2025 - 1.18.2
Oct 20, 2025 - 1.18.1 - RETRACTED
Feb 19th, 2025 - 1.18.0
r.err != nil but return a nil value error err by @alingse in https://github.com/klauspost/compress/pull/1028Oct 11th, 2024 - 1.17.11
Sep 23rd, 2024 - 1.17.10
Jun 12th, 2024 - 1.17.9
Apr 9th, 2024 - 1.17.8
Feb 21st, 2024 - 1.17.7
Feb 5th, 2024 - 1.17.6
Jan 26th, 2024 - v1.17.5
Dec 1st, 2023 - v1.17.4
Nov 15th, 2023 - v1.17.3
Oct 22nd, 2023 - v1.17.2
Oct 14th, 2023 - v1.17.1
Sept 19th, 2023 - v1.17.0
July 1st, 2023 - v1.16.7
June 13, 2023 - v1.16.6
Apr 16, 2023 - v1.16.5
Apr 5, 2023 - v1.16.4
Mar 13, 2023 - v1.16.1
Feb 26, 2023 - v1.16.0
Jan 21st, 2023 (v1.15.15)
Jan 3rd, 2023 (v1.15.14)
Dec 11, 2022 (v1.15.13)
Oct 26, 2022 (v1.15.12)
HeaderNoCompression https://github.com/klauspost/compress/pull/683Sept 26, 2022 (v1.15.11)
Sept 16, 2022 (v1.15.10)
July 21, 2022 (v1.15.9)
July 13, 2022 (v1.15.8)
June 29, 2022 (v1.15.7)
June 3, 2022 (v1.15.6)
May 25, 2022 (v1.15.5)
May 11, 2022 (v1.15.4)
May 5, 2022 (v1.15.3)
Apr 26, 2022 (v1.15.2)
Mar 11, 2022 (v1.15.1)
Mar 3, 2022 (v1.15.0)
Both compression and decompression now supports “synchronous” stream operations. This means that whenever “concurrency” is set to 1, they will operate without spawning goroutines.
Stream decompression is now faster on asynchronous, since the goroutine allocation much more effectively splits the workload. On typical streams this will typically use 2 cores fully for decompression. When a stream has finished decoding no goroutines will be left over, so decoders can now safely be pooled and still be garbage collected.
While the release has been extensively tested, it is recommended to testing when upgrading.
Feb 22, 2022 (v1.14.4)
Feb 17, 2022 (v1.14.3)
Jan 25, 2022 (v1.14.2)
Jan 11, 2022 (v1.14.1)
Aug 30, 2021 (v1.13.5)
Aug 12, 2021 (v1.13.4)
Aug 3, 2021 (v1.13.3)
Jun 14, 2021 (v1.13.1)
Jun 3, 2021 (v1.13.0)
May 25, 2021 (v1.12.3)
Apr 27, 2021 (v1.12.2)
Apr 14, 2021 (v1.12.1)
Mar 26, 2021 (v1.11.13)
Mar 5, 2021 (v1.11.12)
s2sx binary that creates self extracting archives.Mar 1, 2021 (v1.11.9)
Feb 25, 2021 (v1.11.8)
Jan 14, 2021 (v1.11.7)
Jan 7, 2021 (v1.11.6)
Dec 20, 2020 (v1.11.4)
Nov 15, 2020 (v1.11.3)
Oct 11, 2020 (v1.11.2)
Oct 1, 2020 (v1.11.1)
Sept 8, 2020 (v1.11.0)
July 8, 2020 (v1.10.11)
June 23, 2020 (v1.10.10)
June 16, 2020 (v1.10.9):
June 5, 2020 (v1.10.8):
June 1, 2020 (v1.10.7):
May 21, 2020: (v1.10.6)
April 12, 2020: (v1.10.5)
Apr 8, 2020: (v1.10.4)
Mar 11, 2020: (v1.10.3)
Feb 27, 2020: (v1.10.2)
Feb 18, 2020: (v1.10.1)
Feb 4, 2020: (v1.10.0)
nil for previous behaviour. #216-rm (remove source files) and -q (no output except errors) to s2c and s2d commandss2c and s2d commandline tools.The packages are drop-in replacements for standard library deflate, gzip, zip, and zlib. Simply replace the import path to use them:
Typical speed is about 2x of the standard library packages.
| old import | new import | Documentation |
|---|---|---|
compress/gzip | github.com/klauspost/compress/gzip | gzip |
compress/zlib | github.com/klauspost/compress/zlib | zlib |
archive/zip | github.com/klauspost/compress/zip | zip |
compress/flate | github.com/klauspost/compress/flate | flate |
You may also be interested in pgzip, which is a drop-in replacement for gzip, which support multithreaded compression on big files and the optimized crc32 package used by these packages.
The packages implement the same API as the standard library, so you can use the original godoc documentation: gzip, zip, zlib, flate.
Currently there is only minor speedup on decompression (mostly CRC32 calculation).
Memory usage is typically 1MB for a Writer. stdlib is in the same range. If you expect to have a lot of concurrently allocated Writers consider using the stateless compression described below.
For compression performance, see: this spreadsheet.
To disable all assembly add -tags=noasm. This works across all packages.
This package offers stateless compression as a special option for gzip/deflate. It will do compression but without maintaining any state between Write calls.
This means there will be no memory kept between Write calls, but compression and speed will be suboptimal.
This is only relevant in cases where you expect to run many thousands of compressors concurrently, but with very little activity. This is not intended for regular web servers serving individual requests.
Because of this, the size of actual Write calls will affect output size.
In gzip, specify level -3 / gzip.StatelessCompression to enable.
For direct deflate use, NewStatelessWriter and StatelessDeflate are available. See documentation
A bufio.Writer can of course be used to control write sizes. For example, to use a 4KB buffer:
// replace 'ioutil.Discard' with your output. gzw, err := gzip.NewWriterLevel(ioutil.Discard, gzip.StatelessCompression) if err != nil { return err } defer gzw.Close() w := bufio.NewWriterSize(gzw, 4096) defer w.Flush() // Write to 'w'
This will only use up to 4KB in memory when the writer is idle.
Compression is almost always worse than the fastest compression level and each write will allocate (a little) memory.
Here are other packages of good quality and pure Go (no cgo wrappers or autoconverted code):
This code is licensed under the same conditions as the original Go code. See LICENSE file.