3 ms·
It appears to actually compress your JS, rather than make it "shorter but still valid". The code ends up being something like: eval(decompress("hfkfkvj...
by jenscow 5y ago
It appears to actually compress your JS, rather than make it "shorter but still valid".
The code ends up being something like:
eval(decompress("hfkfkvj..."));
function decompress(data) {...}
- Waterluvian 5y agoInteresting. So then it’s just better lossless compression than gzip?
- recursive 5y agoNot necessarily better than gzip, as you have to add the size of the unpacker to the payload.
- lifthrasiir 5y agoNote that while you are correct in principle (for example it will perform poorly for LZ77 best cases), Roadroller reaches a very high compression ratio when used with the typical minified JS input and DEFLATE recompressors. I have kept an internal benchmark using some of js13kGames 2020 entries [1] and for those samples Roadroller universally beat gzip and in most cases even Brotli by a large margin (~8%) even with the embedded decoder. Of course Roadroller is much more computationally expensive though. [1] https://docs.google.com/spreadsheets/d/1dKJWpLPY9fQ2J_COffOJriWlNviv8nxtumgTmGvN-sY https://docs.google.com/spreadsheets/d/1dKJWpLPY9fQ2J_COffOJ...
- recursive 5y agoThanks for the detailed reply. Your name looks familiar. I think I've seen you around some code golf hangouts somewhere on the internet.
- lifthrasiir 5y agoWas that the Anarchy Golf? :-) Otherwise I've been here and there so I might not remember all the places I've ever been.
- recursive 5y agoYes I think so. I used to be moderately active there a few years ago, although not a "regular".