跳至內容

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"

外部連結[編輯]