Zstandard

本页使用了标题或全文手工转换
维基百科,自由的百科全书
Zstandard
原作者Yann Collet
開發者Yann Collet、Przemysław Skibiński(inikep
首次发布2015年1月24日 (2015-01-24)
当前版本
  • 1.5.6 (2024年3月27日;穩定版本)[1]
編輯維基數據鏈接
源代码库 編輯維基數據鏈接
编程语言C
操作系统跨平台
平台可移植
类型数据压缩
许可协议雙授權:BSD许可证, GPLv2
网站facebook.github.io/zstd/

Zstandard(或Zstd)是由FacebookYann Collet英语Yann Collet开发的一个无损数据压缩算法。该名称也指其C语言参考实现。第1版的实现于2016年8月31日发布为自由软件[3][4][5]

特色

设计Zstandard的目的是提供一个类似于DEFLATE算法的压缩比,但更快,特别是解压缩快的算法。它的压缩级别从负5级(最快)到22级(压缩速度最慢,但是压缩比最高)可以调节。[6]

zstd套件里面有压缩和解压缩的并行(多线程)实现。从1.3.2版本(2017年10月)开始,zstd 有选择地实现非常长的搜索和重复数据消除(--long,128MiB窗口),类似于rzip或lrzip。[7]

压缩速度在最快和最慢级别之间可以相差20倍或更多,而解压缩速度统统很快,在最快和最慢级别之间相差不到20%。[8] Zstandard命令行有一个“自适应”(--adapt)模式,根据I/O条件改变压缩级别,主要是写入输出的速度。

Zstd在其最大压缩级别下的压缩比接近lzma、lzham和ppmx,并且比lzabzip2性能更好。[9][10] Zstandard达到了当前的帕累托最优,因为它解压缩的速度比任何其他当前可用的算法都要快,并且有类似的或者更好的压缩比。[11][12]

字典对小文件的压缩比有很大的影响,所以Zstandard可以使用用户提供的压缩字典。它还提供了一种训练模式,能够从一组样本生成一个字典。[13][14] 特别是,可以加载一个字典来处理文件之间具有冗余的大型文件集,但不一定在每个文件(例如日志文件)内。

使用情况

Zstandard
扩展名
.zst
互联网媒体类型
application/zstd[15]
格式类型数据压缩

Linux内核自2017年11月以来就包含了Zstandard (4.14版本) ,作为btrfssquashfs文件系统的压缩方法。[16][17][18]

2017年,Allan Jude将Zstandard集成到FreeBSD内核中,[19] 用于概念验证OpenZFS压缩方法。[8] 随后,它受集成为核心转储(英語:Core dump,台湾作核心傾印)(用户程序和内核崩溃)的压缩器选项。

AWS RedshiftRocksDB数据库支持使用Zstandard进行字段压缩。[20]

2018年3月,CanonicalUbuntu Linux发行版中测试了[21]默认使用zstd作为deb包压缩方法。与deb包的xz压缩相比,级别19的zstd解压缩速度要快得多,但代价是套件文件大小增加了6%。Debian开发者Ian Jackson希望再等几年再官方采用zstd来打包。[22][23][24]

2018年,该算法发布为 RFC 8478,它还定义了相关的媒体类型“application/zstd”、文件扩展名“zst”和HTTP内容编码“zstd”。[25]

2019年10月,随着pacman 5.2包管理器的发布,Arch Linux增加了对zstd包压缩方法的支持,[26] 2020年1月,官方仓库中的包从xz转换为zstd。Arch采用zstd -c -T0 --ultra -20 -,与xz相比,所有压缩包的大小增加了0.8%,解压速度提高了1300%;当使用多个线程时,解压内存增加了50 MiB,压缩内存会增加,但会随着使用的线程数而扩展。[27][28][29][30] 在.NSZ / .XCZ文件格式中完整实现了该算法以及多种压缩等级,[31]任天堂Switch混合游戏机的自制社区开发。[32]

许可协议

参考实现以BSD许可证授权,发布在GitHub上。自1.0版本以来,它有额外的专利权许可。[33]

自1.3.1版,[34]拿掉此专利权许可,授权改成BSD + GPLv2双授权。[35]

参见

参考资料

  1. ^ Release Zstandard v1.5.6 - Chrome Edition · facebook/zstd. [2024年3月27日] (英語). 
  2. ^ Releases - facebook/zstd. [2021-12-21]. (原始内容存档于2021-05-01) –通过GitHub. 
  3. ^ Sergio De Simone, Facebook Open-Sources New Compression Algorithm Outperforming Zlib页面存档备份,存于互联网档案馆(英文) / InfoQ, Sep 02, 2016
  4. ^ Facebook开源新的压缩算法,性能超zlib. InfoQ. 2016-09-06 [2017-06-11]. (原始内容存档于2018-11-02) (中文(中国大陆)). 
  5. ^ Life imitates satire: Facebook touts zlib killer just like Silicon Valley's Pied Piper. The Register. 2016-08-31 [2016-09-06]. (原始内容存档于2018-11-23). 
  6. ^ https://github.com/facebook/zstd/releases/tag/v1.3.4页面存档备份,存于互联网档案馆) Faster compression levels
  7. ^ Command Line Interface for Zstandard library. GitHub (英语). 
  8. ^ 8.0 8.1 ZStandard in ZFS (PDF). open-zfs.org. 2017 [2019-04-20]. (原始内容存档 (PDF)于2019-12-18). 
  9. ^ Matt Mahoney. Silesia Open Source Compression Benchmark. [2019-05-10]. (原始内容存档于2022-01-21). 
  10. ^ Matt Mahoney. Large Text Compression Benchmark, .2157 zstd. 2016-08-29 [2016-09-01]. (原始内容存档于2022-03-31). 
  11. ^ TurboBench: Static/Dynamic web content compression benchmark, PowTurbo, [2020-06-13], (原始内容存档于2022-03-17) 
  12. ^ Matt Mahoney, Silesia Open Source Compression Benchmark, [2020-06-13], (原始内容存档于2022-01-21) 
  13. ^ Facebook developers report massive speedups and compression ratio improvements when using dictionaries (PDF). [2020-06-13]. (原始内容存档 (PDF)于2018-01-25). 
  14. ^ Smaller and faster data compression with Zstandard. Facebook. 31 August 2016 [2017-06-11]. (原始内容存档于2020-11-08). 
  15. ^ Zstandard Compression and the application/zstd Media Type. Tools.ietf.org [2019-06-13]. RFC 8478. 
  16. ^ The rest of the 4.14 merge window [LWN.net]. lwn.net. [2020-06-13]. (原始内容存档于2021-11-22). 
  17. ^ Linux_4.14 - Linux Kernel Newbies. Kernelnewbies.org. [2018-08-16]. (原始内容存档于2018-01-10). 
  18. ^ Zstd Compression For Btrfs & Squashfs Set For Linux 4.14, Already Used Within Facebook - Phoronix. www.phoronix.com. [2020-06-13]. (原始内容存档于2019-07-25). 
  19. ^ https://github.com/freebsd/freebsd/commit/28ef16535cde21eeeaf75f6006b3a77952b3b51
  20. ^ Zstandard Encoding - Amazon Redshift. 20 April 2019 [2020-06-13]. (原始内容存档于2021-08-14). 
  21. ^ Larabel, Michael. Canonical Working On Zstd-Compressed Debian Packages For Ubuntu. phoronix.com. Phoronix Media. 12 March 2018 [29 October 2019]. (原始内容存档于2021-08-16). The developers at Canonical are considering a feature freeze exception to get this newly-developed Zstd Apt/Dpkg support in Ubuntu 18.04 LTS. In doing so, they mention they would be looking at enabling Zstd compression for packages by default in Ubuntu 18.10. 
  22. ^ New Ubuntu Installs Could Be Speed Up by 10% with the Zstd Compression Algorithm. Softpedia. Mar 12, 2018 [13 August 2018]. (原始内容存档于2021-10-06). 
  23. ^ Canonical Working On Zstd-Compressed Debian Packages For Ubuntu. phoronix. 12 March 2018 [13 August 2018]. (原始内容存档于2021-08-16) (英语). 
  24. ^ RFC: Support for zstd in .deb packages?页面存档备份,存于互联网档案馆), Ian Jackson, 2018-04-27.
  25. ^ Collet, Yann; Kucherawy, Murray, RFC 8478: Zstandard Compression and the application/zstd Media Type, Internet Engineering Task Force Request for Comments, Menlo Park, CA: IETF Trust, 2018 
  26. ^ 存档副本. [2020-06-13]. (原始内容存档于2022-03-18). 
  27. ^ Broda, Robin. Now using Zstandard instead of xz for package compression. Arch Linux. 2020-01-04 [2020-01-05]. (原始内容存档于2022-03-18). 
  28. ^ [arch-dev-public RFC: (devtools) Changing default compression method to zstd] (页面存档备份,存于互联网档案馆), Robin Broda, 2019-03-25.
  29. ^ Clarify zstd compressor output compatibility guarantees across versions页面存档备份,存于互联网档案馆), Yann Collet, assuring important for the same binary result is zstd version and compression level, 2019-03-18.
  30. ^ makepkg.conf: change default compression method to zstd页面存档备份,存于互联网档案馆), Robin Broda, Levente Polyak, default compression with zstd -c -T0 --ultra -20 -, 2019-12-27.
  31. ^ RELEASE - nsZip - NSP compressor/decompressor to reduce storage. GBAtemp.net - The Independent Video Game Community. [2019-11-03]. (原始内容存档于2021-08-15) (美国英语). 
  32. ^ Bosshard, Nico, nsZip is a tool to compress/decompress Nintendo Switch games using the here specified NSZ file format: nicoboss/nsZip, 2019-10-31 [2019-11-03], (原始内容存档于2022-03-27) 
  33. ^ zstd/PATENTS "Additional Grant of Patent Rights Version 2"页面存档备份,存于互联网档案馆), Facebook
  34. ^ "Zstd v1.3.1 release"页面存档备份,存于互联网档案馆), GitHub "facebook/zstd"
  35. ^ "New license"页面存档备份,存于互联网档案馆), GitHub "facebook/zstd"

外部链接