Compress contract specs with gzip and store in contractspecv0gzip #1178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Compress contract specs with gzip and store in contractspecv0gzip.
Why
This is an experiment to see if compressing contracts specs would sufficiently address concerns of contract spec size. I used gzip out of convenience. Xz/lmza would be better, but I had problems building the libs for it which is a good signal it'd be too hard to adopt everywhere contract specs need decoding.
The results were underwhelming.
Most of the test vector contracts size in this repo reduced by tiny amounts, less than 40 bytes.
The token contract interface size was over 5000 bytes to start. Gzipping reduced it into the 3000s. However, when I removed the doc comments from the contract spec, the 5000+ byte spec was reduced to 1004 bytes, and then when I gzipped that it was reduced to only 963, a 41 byte saving without doc comments.
This is pretty good signal that doc comments are a large cost and simply not using them is a massive saving. And also that gzipping isn't a win without doc comments.
I'm not convinced compression is worth adding, but interested in hearing peoples thoughts.
Close #415