Live data from Hacker News

Minification Is Evil

todepond.com

91–93 of 93 posts

Re: Minification Is Evil

#91
post #88
post #49

Earlier quoted context omitted.

I just checked: 514kB gzip vs 314kB minified+gzip. Not negligible, IMO.

How big was your original JS package that it gzipped down to 514kB? Like 30 megs? Really sounds like you have bigger problems.

It's a large web app, sure, but gzip doesn't do 60x compression. 9-10x at best. But it's not a problem. It's for a small-ish group of people, and it's better to do the editing and some processing in the browser than on the server. The app uses relatively few components in that build at the same time, so it's not sluggish. There are also some "assets" in there. I don't like the practice, but my colleague does, so he occasionally puts things like images and fonts in there.

OTOH: it shows data. A normal size data set is 2000-3000x rows and 300-500 columns. If you output that as a simple table, the browsers gets super-slow. So another component has to be added. It adds up.

Re: Minification Is Evil

#92
post #87

Earlier quoted context omitted.

Saving 200 bytes is "still huge"? For me 200 bytes is not worth the extra headaches minification introduces.

You're the one who complained my examples files were too big. This is about the general discussion around minification. I don't care the specifics of your particular usecase. The point is that it reduces filesizes even after gzip. You having an arbitrary threshold around 200 bytes is not interesting.

My point is that for most people, the size savings of minification are going to be miniscule because most people are dealing with small JS files. Not only that but it makes debugging a much bigger pain. You start needing to generate and distribute map files, you can no longer easily observe or modify state from Dev console, etc.

I'm not completely opposed to minification. Distributing some self contained library like OpenCV.js? Minify away. But minifying everything even application files under active development just impedes developer velocity IMO for very little benefit. You shave off a couple hundred bytes in exchange for worse development/debugging and ostensibly faster page loads but realistically the same page loads.

Re: Minification Is Evil

#93

Earlier quoted context omitted.

> Edit: something important to note: some frameworks (e.g. React) have lots of comments on their un-minified versions, that are removed when minified. That affects their size greatly. Are you telling us your code doesn't? :-)

Hah! It's self-documenting! Nah, in a more serious note, to properly compare the impact of minification, I should remove the comments from the unminified (maxified?) version first. :)

Nah that wouldn't be fair, the code I serve my users initially has comments too and the arguments that people bring to criticize minification is that it adds complexity if you want to read the code in the browser. The comments should stay
Post reply on HN