缩小的javascript会提高性能吗? [英] Does minified javascript improve performance?

查看:141
本文介绍了缩小的javascript会提高性能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在制作AIR应用程序(因此下载时间没有太大的影响),组合和减少所有javascript文件是否会影响性能?混淆会如何影响性能。

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 obfuscating affect the performance.

推荐答案

通过减少加载时间(即使只是略微),Minify可以提高整体页面的性能。

Minifying improves performance for your page overall by decreasing the load time (even if only slightly).

对于绝大多数的javascript代码,缩小或混淆改变执行时间的任何可察觉的数量

Neither minifying nor obfuscating alter execution time by any perceivable amount for the vast majority of javascript code out there.

我建议缩小这些原因以及更多原因。一起缩小多个脚本(比如jQuery和它的插件)可以节省更多。

I do recommend minifying for those reasons and more. Minifying multiple scripts together (like jQuery and it's plugins) can yield even greater savings.

编辑:
正如所指出的,约束设备和/或非常代码库缩小可能会产生明显的结果。

As pointed out, on constrained devices and/or with very large codebases minifying could yield a noticeable result.

这篇关于缩小的javascript会提高性能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆