Optimizing Lua string literals to save 400 bytes(purplesyringa.moe) |
Optimizing Lua string literals to save 400 bytes(purplesyringa.moe) |
I also explored building precomputed dictionaries, which means you can easily embed the files individually (which simplifies compilation and loading through the Lua C API) while getting similar compression ratios as when compressing an enormous file (e.g. a concatenation of all the source files). This is trivial with the zstd reference utility. It's also simple for deflate, though you have to roll your own dictionary builder by hacking the implementation. But I never bothered implementing it beyond the benchmark harness. I probably would have stuck with deflate rather than switching to zstd just because the compiled inflate implementation is so small.
[1] https://github.com/madler/zlib/blob/develop/contrib/puff/puf...
> I use SI prefixes for bytes. You should too!
The prefix for 1000 is lowercase.