4 ms·
I recently reworked how zstd builds its Huffman decoding tables (not decoding itself) to avoid unpredictable branches and speed the table building up by about
by terrelln 6y ago
I recently reworked how zstd builds its Huffman decoding tables (not decoding itself) to avoid unpredictable branches
and speed the table building up by about ~2x [0]. This is insignificant for large decompressions, but if you're decompressing only a few KB, the table building time can dominate the actual decompression.
It sort of goes to show that while Huffman codes have been around for ages, implementations can still improve, especially as the hardware we use changes.
[0] https://github.com/facebook/zstd/pull/2271 https://github.com/facebook/zstd/pull/2271
- utopcell 6y agoNice.