Does minified javascript improve performance?

后端 未结 8 1724
渐次进展
渐次进展 2020-11-27 05:26

I\'m making an AIR application (so download time doesn\'t have a huge impact), does combining and minifing all the javascript files affect the performance? How would obfusca

8条回答
  •  日久生厌
    2020-11-27 05:53

    I can't reply to the comment made by John, regarding cutting parsing time not only in half, but a 3rd (from 12s to 4s), when minifying a file from 3MB to 1MB, but I have serious questions when it comes to the truthy-ness of this statement, even if it was written in 2017.

    When reading about for example on SpiderMonkey, Firefox's Javascript Engine, there seem to be pretty much documentation that could explain a performance penalty on minifying javascript source code. And this has everything to do with Lazy Parsing or deferring parsing of a function until it's ultimately needed. This would spread parsing out over the full execution time T, while it seems to me, that only use case where minifying possibly could improve parsing, is if the entire project is parsed in one go-through (which also seems to be a worst practices kind of design).

    https://blog.mozilla.org/javascript/

提交回复
热议问题