close
The Wayback Machine - https://web.archive.org/web/20200911172257/https://github.com/WebAssembly/design/pull/206
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brotli for BinaryEncoding compression #206

Merged
merged 2 commits into from Jun 21, 2015
Merged

Brotli for BinaryEncoding compression #206

merged 2 commits into from Jun 21, 2015

Conversation

@jfbastien
Copy link
Member

jfbastien commented Jun 19, 2015

I received a suggestion to support Brotli, and the rationale is pretty solid:

The WOFF 2.0 team dropped both gzip and lzma to power their latest system with brotli. Because of that, brotli has already found its way to chrome and android. http://www.w3.org/TR/WOFF20ER/

Brotli can compress 5-25 % more than gzip, is a little bit more efficient for small files than LZMA, and decompresses 3-5x faster than LZMA. (Brotli typically compresses less than LZMA for large files -- above 1 MB or so.)

https://github.com/google/brotli

https://datatracker.ietf.org/doc/draft-alakuijala-brotli/

Once the specifics for WebAssembly are clear, we could even specialize the context map or the static dictionary for WebAssembly (or you can design WebAssembly it in a way that it takes maximum benefit of the existing brotli context modes -- there are three binary modes and an utf-8 mode).

I received a suggestion to support Brotli, and the rationale is pretty solid:

> The WOFF 2.0 team dropped both gzip and lzma to power their latest system with brotli. Because of that, brotli has already found its way to chrome and android. http://www.w3.org/TR/WOFF20ER/
>
> Brotli can compress 5-25 % more than gzip, is a little bit more efficient for small files than LZMA, and decompresses 3-5x faster than LZMA. (Brotli typically compresses less than LZMA for large files -- above 1 MB or so.)
>
> https://github.com/google/brotli
> 
> https://datatracker.ietf.org/doc/draft-alakuijala-brotli/
> 
> Once the specifics for WebAssembly are clear, we could even specialize the context map or the static dictionary for WebAssembly (or you can design WebAssembly it in a way that it takes maximum benefit of the existing brotli context modes -- there are three binary modes and an utf-8 mode).
@jfbastien jfbastien added this to the MVP milestone Jun 19, 2015
@lukewagner
Copy link
Member

lukewagner commented Jun 19, 2015

Brotli might make sense if the WebAssembly were going to specify a form of generic compression, but so far we've decided against that. Perhaps one day we'll get a builtin stream transformer (from the Streams API) so Brotli will be an attractive option for that reason. Otherwise, I'd at least include lzma and lzham in the list of alternatives.

@jfbastien
Copy link
Member Author

jfbastien commented Jun 19, 2015

@lukewagner agreed, I added LZHAM.

@MikeHolman
Copy link
Member

MikeHolman commented Jun 19, 2015

lgtm

jfbastien added a commit that referenced this pull request Jun 21, 2015
Brotli for BinaryEncoding compression
@jfbastien jfbastien merged commit 1b3f592 into master Jun 21, 2015
@jfbastien jfbastien deleted the brotli branch Jun 21, 2015
@jedie
Copy link

jedie commented Jun 22, 2015

I also look for a good compressor. The starting point is: pypyjs/pypyjs.github.io#4

It's not easy to find a compressor. Because there are different requirements.
In this case, i think the format must be have:

  • fast decompression speed
  • less memory usage while decompression

The main question is: What's fast enough?!?
This depend on download speed.

There are two good resources for compression algorithm:

Here a chart from the first link with:

  • data: Tarred executables of Mozilla 1.0 (Tru64 UNIX edition)
  • machine: beagleboard-xm

unbenannt

You can see, in this case brotli is nice. But lzham is faster and has a better ratio...

I don't know if lzham will be fast enough.

There are some more interesting compressors. You will find some interesting at the second link: http://mattmahoney.net/dc/text.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.