3 ms·
One of the messages in the thread links to this debian wiki article that lays out all the arguments against minification. https://wiki.debian.org/onlyjob/no-mi
by prolepunk 11y ago
One of the messages in the thread links to this debian wiki article that lays out all the arguments against minification.
https://wiki.debian.org/onlyjob/no-minification https://wiki.debian.org/onlyjob/no-minification
One argument that really drives it home -- GZIP compression without minification is faster and better, and from my own experience takes exactly two lines of nginx config to set up.
Is there really any benefit of using minification besides code obfuscation?
- cwyers 11y agoDefine "faster." GZIP creates a smaller file size, but the benefit of minification is faster parsing by the Javascript engine -- GZIP does nothing to help with this.
- ape4 11y agoMaybe not always. Minifiers optimize for space. So they might turn "false" into "!1". Not sure that executes faster.
- jhgg 11y agoUglifyJS does a lot of dead code elimination. Lots of stuff that only runs on dev environments isn't even included in the production build. Stuff like: if (process.env.NODE_ENV !== 'production') { invariant(x, y); console.info(z); }
- BinaryIdiot 11y agoSo yeah they optimize for space but they also optimize for execution. For example the closure minifier literally puts everything on one line, without semicolons (where possible) and uses commas which forces the JavaScript engine to execute it as a single statement which can be faster. That's just a minor point but it can help with speed. Is it enough of an optimization that it's worth it though? I'm not sure; I haven't seen much in the way of benchmarks in this area.