Does minified javascript improve performance?

后端 未结 8 1657
渐次进展
渐次进展 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:56

    I'd like to post this as a separate answer as it somewhat contrasts the accepted one:

    Yes, it does make a performance difference as it reduces parsing time - and that's often the critical thing. For me, it was even just simply linear in the size and I could get it from 12s to 4s parse time by minifying from 3MB to 1MB.

    It's not a big app either, it just has a couple of reasonable dependencies.

    So the moral of the story here is: Yes, minifying is important for performance - and not because of bandwidth, but because of parsing.

    0 讨论(0)
  • 2020-11-27 06:00

    Minification does not improve the speed at which JavaScript executes at runtime, which I believe it what you're really interested in. In fact, if you use Packer's Base64 compression, it's actually slower on initial load.

    Minification will reduce the size of the JavaScript though, making your application's download size smaller.

    0 讨论(0)
提交回复
热议问题