6 Commits

Author SHA1 Message Date
LemonBoy
20fba0933f std/deflate: Avoid reading past end of stream
Use a conservative (and slower) approach in the Huffman decoder fast
path.

Closes #6847
2020-10-29 17:16:03 +01:00
LemonBoy
9fe4c89230 std: Add a gzip decoder 2020-09-11 20:02:41 -04:00
LemonBoy
4b851c7255 Re-enable a compression test
It somehow got commented out...
2020-09-11 21:04:08 +02:00
LemonBoy
41f244bd2f std: Make the DEFLATE decompression routine 3x faster
A profiler run showed that the main bottleneck was the naive decoding of
the Huffman codes, replacing it with a nice trick borrowed by Zlib gave
a substantial speedup.
Replacing a `%` with a `and (mask-1)` gave another significant
improvement (yay for low hanging fruits).

A few numbers obtained by decompressing a 22M file:

Before:
```
./decompress  2,39s user 0,00s system 99% cpu 2,400 total
```

After:
```
./decompress  0,79s user 0,00s system 99% cpu 0,798 total
````
2020-09-11 21:00:15 +02:00
Timon Kruiper
61cd9099e2 Zlib: Make deinit function public 2020-09-08 12:21:49 -04:00
LemonBoy
2328f40b7a std: Add DEFLATE and zlib decompressors 2020-09-07 14:59:46 -07:00