Raul Fraile: How GZIP compression works | JSConf EU 2014
Вставка
- Опубліковано 24 сер 2024
- Data compression is an amazing topic. Even in today’s world, with fast networks and almost unlimited storage, data compression is still relevant, especially for mobile devices and countries with poor Internet connections.
For better or worse, GZIP compression is the de-facto lossless compression method for compressing text data in websites. It is not the fastest nor the better, but provides an excellent tradeoff between speed and compression ratio. The way Internet works makes it also difficult to use newer compression methods.
This talk examines how GZIP works internally, explaining the internals of the DEFLATE algorithm, which is a combination of LZ77 and Huffman coding. Different implementations will be compared, such as GNU GZIP, 7-ZIP and zopfli, focusing on why and how some of these implementations perform better than others.
Finally, we will try to go beyond GZIP, preprocessing our data to achieve better results. For example, transposing JSON.
Transcript & slides: 2014.jsconf.eu/...
License: For reuse of this video under a more permissive license please get in touch with us. The speakers retain the copyright for their performances.
Why is the presenter taking up the majority of the screen instead of the slides 90% of the time? Text is unreadable.
4:31 "facial eggs presentations"
Machine translations FTW!
Loved the presentation, thanks!
Nice informative and neatly presented. Thanks alot
Great talk. Thanks!
what's the difference between gzip and zlib?
Both gzip and zlib streams are very thin container formats around the Deflate algorithm. Gzip can contain slightly more extra information (timestamps, filenames, comments, etc), but not in practice. Although both of them do allow algorithms other than Deflate, neither actually defines any. Read RFC 1950, 1951, and 1952, they are all quite short.
zlib is an abstraction of gzip. They both work on the same algorithm, but zlib is just a library.
@@baganatube Are you certain that gzip is a container format? You generally need to use .tar.gz with tar being the container format and gz being mere compression.
@@Chai-T-Rex By "container" I didn't mean collecting multiple files into one stream, for which you need a format like tar.
@@baganatube Ahh, OK. I looked into it and I didn't know that gzip stored the original filename. Thanks!
Does Gzip change what you see when using View Source?
no
11:04 that huffman encoding is wrong. its impossible to tell whether the first 3 0s are 3 Ls, an H and an L, or a D. Dude didn't even try to make a proper huffman tree, just listed binary strings in lexicographical order and assigned a value to them.
I thought the same thing, but he starts correcting that 10 seconds later.