5 ms·
I can't tell if this is satire or not, but I'm assuming it's genuine. Compression is not a replacement for minification. The client still needs to parse and ru
by wldlyinaccurate 5y ago
I can't tell if this is satire or not, but I'm assuming it's genuine.
Compression is not a replacement for minification. The client still needs to parse and run the uncompressed source code. Minification provides measurable performance gains for clients by reducing parse times and p̴o̴t̴e̴n̴t̴i̴a̴l̴l̴y̴ ̴e̴v̴e̴n̴ ̴a̴l̴l̴o̴w̴i̴n̴g̴ ̴f̴u̴n̴c̴t̴i̴o̴n̴s̴ ̴t̴o̴ ̴b̴e̴c̴o̴m̴e̴ ̴s̴m̴a̴l̴l̴ ̴e̴n̴o̴u̴g̴h̴ ̴t̴h̴a̴t̴ ̴t̴h̴e̴y̴ ̴c̴a̴n̴ ̴b̴e̴ ̴i̴n̴l̴i̴n̴e̴d̴ (the inclining part is not true anymore; see child comment).
Licence retention isn't a reason to skip minification either. Practically every modern minified retains licence comments.
And finally, your users can still read the original source code if you ship source maps.
Care about your users, please minify your JavaScript :)
- lucb1e 5y ago> Minification provides measurable performance gains for clients by reducing parse times That sounds like an omission from the talk indeed, assuming the gains are indeed noticeable and not just theoretically measurable. Do you have some numbers for this, or a link to some?
- lhorie 5y ago> potentially even allowing functions to become small enough that they can be inlined Apparently, that's no longer the case, at least in V8[0] Parse times however are indeed a real concern and start to matter a lot as you go down the list of mobile hardware and their performance. This graph[1] shows parse times for a 1MB bundle of JavaScript in various devices. [0] https://github.com/v8/v8/commit/0702ea3000df8235c8bfcf1e99a948ba38964ee3#diff-64e6fce9a2a9948942eb00c7c1cb75f2 https://github.com/v8/v8/commit/0702ea3000df8235c8bfcf1e99a9... [1] https://miro.medium.com/max/1400/1*dnhO1M_zlmAhvtQY_7tZmA.jpeg https://miro.medium.com/max/1400/1*dnhO1M_zlmAhvtQY_7tZmA.jp...
- vvanpo 5y agoThat graph shows results for Chrome 55. According to https://v8.dev/blog/cost-of-javascript-2019 https://v8.dev/blog/cost-of-javascript-2019, parse times in Chrome have improved significantly over the years.
- lhorie 5y agoYes, but performance differences between various devices are still fairly significant, as per your own link[0], meaning we probably shouldn't disregard potential performance gains from minification in slower devices. [0] https://v8.dev/_img/cost-of-javascript-2019/reddit-js-processing-devices.svg https://v8.dev/_img/cost-of-javascript-2019/reddit-js-proces...
- wldlyinaccurate 5y agoWhoa, I had no idea they'd fixed the inlining-by-size - thanks for pointing that out!
- thunderbong 5y agoI have to agree. But what I really need to know is how you created the strike-through effect on the words in your comment! (Since I don't see it in the HN format help[0]) [0]: https://news.ycombinator.com/formatdoc https://news.ycombinator.com/formatdoc
- gabrielsroka 5y agoThere are Unicode characters that are strike-through, bold, etc. It's not actual formatting.