php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #77281 zstandard compression support
Submitted: 2018-12-11 05:57 UTC Modified: 2018-12-11 14:39 UTC
From: rh_whatwg at skuldwyrm dot no Assigned:
Status: Suspended Package: *Compression related
PHP Version: Next Major Version OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rh_whatwg at skuldwyrm dot no
New email:
PHP Version: OS:

 

 [2018-12-11 05:57 UTC] rh_whatwg at skuldwyrm dot no
Description:
------------
zstandard provides better compression at it's lowest level than deflate (zlib / gzip) on it's highest level.
zstandard is also faster that deflate on both compression and decompression.

https://facebook.github.io/zstd/

By the looks of it zstandard can become the longterm replacement/successor for both gzip and bzip.

The webserver ngninx has a feature request for zstandard and support should be added soon (I believe nginx master has it by now).
Weget2 supports it as well.

IANA and RFCs exists that define it properly so it should only be a matte of time before it joins brotli and gzip as part of the compression methods browsers support.

PHP can help speed up adoption by adding support for it in the next major (8.0) or if possible minor (7.4) release.

zstandard license is the 3 clause BSD, the previous controversy that facebook initially added added a "+PATENTS" clause has been removed, so the license is now the normal 3 clause BSD.

Speeds varies and there are a lot of benchmarks available now if you search the net (so you don't have to take my word for it). Speed can be on par with lz4 while compression can be on par with bzip and lzma. There are levels of compression from 1 to 19 with extra ultra levels from 20 to 22.

The reference implementation includes multithread support which roughly doubles the compression speed with no major impact on compression ratio, this "should" work fine on non-threadsafe PHP builds as well.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2018-12-11 14:39 UTC] cmb@php.net
-Status: Open +Status: Suspended
 [2018-12-11 14:39 UTC] cmb@php.net
For reference:

  <https://tools.ietf.org/html/rfc8478>
  <https://github.com/kjdev/php-ext-zstd>

Anyhow, this topic certainly requires discussion on internals@,
and likely the RFC process[1].  Feel free to start it!  For the
time being, I'm suspending this ticket.

[1] <http://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 07:01:28 2024 UTC