算法与计算机科学github.com编辑精选
Zstandard:快速实时压缩算法
Zstandard – Fast real-time compression algorithm
2018 — 2022,它一次次回到首页
黑点是上首页(≥ 50 分)的那次投稿,空心点是没冲上去的投稿,点越大分数越高。
导读
Zstandard(zstd)是 Facebook 开源的快速压缩算法,目标是在压缩比与速度之间取得优秀平衡,适用于实时/高吞吐场景。该 GitHub 仓库包含参考实现、文档与基准测试;它后来被标准化为 RFC 8478,并以 zstd 之名注册为 HTTP 参数。
为什么经久不衰:它把高压缩比和高速度结合得很好,已被 HTTP、文件系统、日志存储等广泛采用,因此多年来反复登上 Hacker News 首页,今天仍是理解现代压缩工程的重要入口。
HN 评论精选
说明 zstd 已有正式标准与注册名。
它已被标准化为 RFC 8478,并以 zstd 为名称在 IANA 的 HTTP 参数注册表中登记。
pierreneter查看英文原文
It has been standardized as RFC 8478 (https://tools.ietf.org/html/rfc8478) and Hypertext Transfer Protocol (HTTP) Parameters (https://www.iana.org/assignments/http-parameters/http-parameters.xhtml) with name: zstd
指出 real-time 措辞有歧义,实际指高吞吐而非硬实时。
这里的“实时”大概指“接近线速”,而不是“硬实时(每个字节处理时间恒定)”,对吧?后者可能更令人印象深刻,但措辞有点含糊。
yjftsjthsd-h查看英文原文
So "real-time" here means "probably line speed", not "hard realtime (constant time per byte)", right? That's probably more impressive, but a bit ambiguous phrasing.
实际项目验证 zstd 高性能。
我需要为一个块存储项目压缩 TCP 流,zstd 让我印象非常深刻。结合 io_uring,与用 socat 发送未压缩数据相比,我发送并压缩数据时 CPU 占用更低、吞吐更高。
fathyb查看英文原文
I needed to compress a TCP stream [0] for a block-storage project and I've been very impressed with zstd. Combined with io_uring, I'm getting less CPU usage and higher throughput to send and compress data than using socat to send uncompressed data. [0]: https://github.com/fathyb/zstd-proxy
肯定 zstd 对特定数据有效,并期待存储层透明压缩。
我们交易日志用 delta 编码二进制格式,zstd 对最后一段仍处理得相当好。可惜存储提供商不愿做透明压缩。日志存 S3 和本地都得自己压缩,有点烦;要是 S3 能代劳就好了。还没试 btrfs 的透明 zstd 压缩,也许值得一试。
renewiltord查看英文原文
We have a delta-encoded binary format for trade logs that we use and zstd still does a pretty good job on them for the last bit. It's just a pity that storage providers won't implement transparent compression. We store our logs on S3 and on-prem and it's just annoying that we have to store them compressed on S3. Would be cool to just store without the compression stage and have S3 do that bit. I haven't tried btrfs with the transparent zstd compression, but perhaps worth a shot.
历次讨论
同类还值得读
位运算技巧集
Bit Twiddling Hacks
斯坦福页面上的经典位运算技巧合集,收录了 popcount、前导/尾随零、位反转、交换、舍入等大量技巧,并附有解释和性能讨论。
算法与计算机科学上首页 8 次 · 2011–2024graphics.stanford.edu编辑精选如何不按平均评分排序
How Not To Sort By Average Rating
经典文章解释了为什么按平均评分排序不可靠:只有少量评价的条目(比如仅一条五星)会轻易排到最前,而评价数量的差异被忽略。
算法与计算机科学上首页 7 次 · 2009–2024evanmiller.org编辑精选数据结构可视化
Data Structure Visualizations
旧金山大学 David Galles 教授制作的数据结构与算法交互式可视化网站,涵盖 B 树、红黑树、排序、图算法等,可逐步操作观察其运行过程。
算法与计算机科学上首页 6 次 · 2011–2021cs.usfca.edu编辑精选1996 年以来的计算机科学最佳论文奖
Best Paper Awards in Computer Science since 1996
Jeff Huang 维护的一个汇总页面,收录了自 1996 年以来计算机科学各主要会议的“最佳论文奖”获奖名单,并按年份和会议整理,方便读者一站式浏览历届获奖论文。
算法与计算机科学上首页 6 次 · 2010–2018jeffhuang.com编辑精选算法(Jeff Erickson)
Algorithms, by Jeff Erickson
伊利诺伊大学 Jeff Erickson 教授的算法课教材,免费在线开放。
算法与计算机科学上首页 5 次 · 2018–2022jeffe.cs.illinois.edu编辑精选