|
|
|
|
|
by dlbucci
1366 days ago
|
|
A year ago, I was making a game for JS13K, where the goal is to make a game that fits in a zip file under 13,312 bytes. I had a two spots that were using the exact same copy-pasted chunk of code, so I figured I'd refactor it into a function to save space, but it actually _increased_ the size of the final zip when I did so.
Turns out zip files compress repetitions of the same exact text _very_ well. |
|
This is a different technique from entropy coding, which gets its improvements by allocating fewer bits for more frequent symbols. But most modern compresses uses a mix, for example gzip uses DEFLATE, which is a combination of literal backrefs and dynamic and static Huffman tables.
and Yes, JSON is usually absurdly compressible.