by wldlyinaccurate · 5y ago · 0 comments
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 :)
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/0702ea3000df8235c8bfcf1e99a9...
[1] https://miro.medium.com/max/1400/1*dnhO1M_zlmAhvtQY_7tZmA.jp...
[0] https://v8.dev/_img/cost-of-javascript-2019/reddit-js-proces...
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?
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])