TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Zstandard Go Compression Package

4 点作者 klauspost将近 6 年前
I am happy to announce the availability of the first Zstandard compressor written in Go. This package will allow you to get very fast compression to Zstandard - an awesome compression format by Yann Collet.<p>The current compressor is focused mainly on speed and outperforms gzip&#x2F;deflate typically by a factor of 3x for similar compression ratios. It is also within a reasonable margin, typically 0.75x the throughput of the reference library called with cgo.<p>Alongside the previously released decompressor, this will allow you to do very fast generic compression and decompression with unrivaled efficiency in pure Go.<p>Both a stream and byte blob compressor is made available and both operate without allocations if re-used, so it will also play nicely with the rest of your application.<p>As a bonus, there is a Snappy -&gt; Zstandard stream converter. This was mainly a development tool, but could be useful for some.<p>Current status: The main goal for the initial release was to get something that would be a feasible replacement for both deflate&#x2F;gzip and the cgo wrapper. The package in its current shape allows to replace both for scenarios where fast compression is required. The compressor has been (fuzz) tested, but may still contain subtle bugs - so if you are dealing with critical data, you might want to do your own testing first.<p>Feedback and experience reports are appreciated. This has taken most of my free time the last several months and has been a great learning experience. I plan to dive into the more efficient (and slower) compression modes next - but feel free to write if you desperately need something else.<p>Also, it seems like Go is the first language to get a Zstandard implementation that isn’t a wrapper around the reference library. Yay!<p>Package &amp; info: https:&#x2F;&#x2F;github.com&#x2F;klauspost&#x2F;compress&#x2F;tree&#x2F;master&#x2F;zstd#zstd

暂无评论

暂无评论