3 ms·
Out of curiosity, I went ahead and calculated deltas between jQuery 2.2.3 -> 2.2.4 minified versions. It generated a 512 byte delta string, instead of download
by eknkc 10y ago
Out of curiosity, I went ahead and calculated deltas between jQuery 2.2.3 -> 2.2.4 minified versions.
It generated a 512 byte delta string, instead of downloading the new version of 83KB, 512 bytes seems like a pretty significant optimisation. Also, 2300 bytes for 2.2.0 -> 2.2.4.
I haven't seen a lot of great service worker uses so far but this seems plausible. Good job.
Delta if you wonder what it looks like: https://gist.github.com/eknkc/fb27cfaee871a007c3cabfda5df03ab0 https://gist.github.com/eknkc/fb27cfaee871a007c3cabfda5df03a...
- JoshTriplett 10y agoNice! I wonder how the delta size compares to something like rsync or bsdiff?
- deno 10y ago376 bytes for bsdiff(utf8, utf8), which is of course worse than brotli/gzip(utf8(text delta)) (267/305 respectively).
- JoshTriplett 10y agoInteresting! I looked into bsdiff, and apparently it internally uses bzip2 for compression of several components independently. As a quick hack, I modified it to output all those pieces uncompressed (producing a large file of mostly 0s), and then tried compressing the result with various compressors, both to test other compressors, and to compress the entire file as one unit rather than as separate components. The result ("ubsdiff" is bsdiff without compression): 85659 jquery-2.2.3.min.js 85578 jquery-2.2.4.min.js 376 jquery.bsdiff 85994 jquery.ubsdiff 264 jquery.ubsdiff.brotli 252 jquery.ubsdiff.brotli9 309 jquery.ubsdiff.bz2 403 jquery.ubsdiff.gz 360 jquery.ubsdiff.xz So, 376 bytes for unmodified bsdiff, 309 bytes by compressing the whole uncompressed bsdiff file with bzip2, 264 bytes by compressing the whole uncompressed bsdiff file with brotli, and (strangely) 252 bytes with quality 9 brotli (the default is 11).
- JoshTriplett 10y agoTrying the same thing with a larger delta (jquery-2.2.4.min.js to jquery-3.1.0.min.js) produced different compressor rankings, though: 85578 jquery-2.2.4.min.js 86351 jquery-3.1.0.min.js 8663 jquery.bsdiff 101359 jquery.ubsdiff 8380 jquery.ubsdiff.brotli 9209 jquery.ubsdiff.brotli9 8853 jquery.ubsdiff.bz2 9550 jquery.ubsdiff.gz 8360 jquery.ubsdiff.xz In this case, bzip2 of the whole file did noticeably worse than bsdiff's compression of three separate components. brotli of the whole file still won, though. Which made me wonder if brotli of the individual components would do better than brotli of the whole file. Turns out it does: 8006 bytes.
- deno 10y agoIt’s actually just 267 bytes compressed with brotli, 305 gzipped. OTOH, the entire jQuery 2.2.4 is just 26k brotli compressed, 29k gzipped.