Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cli, completion: compress some
const
strings (#652)
This uses `supersnappy` [1], which is a zero-dependency pure-Nim implementation of Google's Snappy [2]. With it, it is straightforward to compress our larger `const` strings at compile time and uncompress them at run time. For now, this commit compresses: - The `configlet --help` message - The completion scripts `supersnappy` is less than 500 lines of code, which is why compressing these strings (which aren't so large) produces a slightly smaller configlet binary, despite the added dependency. We may end up adding `zippy` [3] as a dependency if configlet learns to make network requests (e.g. for the online `configlet lint` checks) so that we can use gzip. But we can't use `zippy` at compile time, so it isn't useful for this commit, even though the compression is better. `zippy` is also a bigger dependency (about 40 KiB), so it wouldn't produce a net saving for this commit anyway. `nim-snappy` [4] is an alternative Snappy implementation, but it would add dependencies [5] on `faststreams`, `unittest2`, and `stew`. [1] https://github.com/guzba/supersnappy [2] https://github.com/google/snappy [3] https://github.com/guzba/zippy [4] https://github.com/status-im/nim-snappy [5] https://github.com/status-im/nim-snappy/blob/7cb2e57a5861/snappy.nimble Closes: #651
- Loading branch information