This week, I wrote about using the CSS tl;dr: the issue isn't the Let's dig in! wtf is gzip!?The Gzipping a file means sending it down the wire in this compressed format. The cool thing about gzipped files is that they can be sent compressed in that format from the server, and browsers can unzip them and run them on-the-fly. Even though that involves some work for the browser, because the how much it reduces the size of files, it has a dramatic improvement on web performance. But, compression is kind of weird. You'd expect compression to work uniformly, but it doesn't. Small files see their size shrink by very little. In some cases, the compressed files are bigger than the original. By comparison, large files compress by orders of magnitude. I wanted to test how different sized bundles for Kelp, my HTML-based UI library, were affected by gzipping. Current SetupThis is how Kelp is currently setup while in development in alpha…
With gzipping, some files were ½ the size of the original, some were the same size, and many were a little bigger than the uncompressed files. Concatentated SetupI used ESBuild to create some bundles, then ran them through gzip with the stock settings.
As you can see, compressing bigger files resulted in files that were more than 80-percent smaller! ConclusionsBased on this, the native If the files I was importing were larger, it might make sense. As tiny, modular files? Not so much! The complete library concatenated and gzipped is less than a single HTTP request. It's just over 25-percent of the transfer size of sending modular gzipped files instead. However, the complete code base will continue to grow as a I add more components. I'll need to run more tests then and figure out the right move. Like this? A Go Make Things membership is the best way to support my work and help me create more free content. Cheers, Want to share this with others or read it later? View it in a browser. |
0 Komentar untuk "[Go Make Things] gzip performance is wild!"