哪个javascript缩小库产生更好的结果? [英] Which javascript minification library produces better results?

查看:186
本文介绍了哪个javascript缩小库产生更好的结果?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Yahoo! UI Compressor Dean Edwards Packer jsmin ,在产生足迹方面产生更好的结果,在混淆时产生更少的错误。

Between Yahoo! UI Compressor, Dean Edwards Packer and jsmin, which produces better results, both in terms of resulting footprint and fewer errors when obfuscating.

推荐答案

这里有点主观,因为有多个因素要考虑(甚至超出你列出的因素):

Better is a bit subjective here, since there are multiple factors to consider (even beyond those you list):


  1. 压缩大小并不能说明整个故事,因为由于在浏览器解释之前运行解包代码所需的额外时间,积极的压缩器会导致运行时性能降低。


    • 当您控制输入代码时,最容易避免错误 - 明智地使用分号会有很长的路要走。对代码运行JSLint,并修复报告的任何问题。

    • 当然,代码本身的样式和大小会影响结果。

    • 最后,值得记住的是,服务器端gzip压缩总是会导致比任何代码压缩更小的下载,尽管一些代码压缩工具将更有效地与gzip结合。

我的建议是运行你打算通过几台压缩机压缩的代码(自动比较工具,如 CompressorRater 帮助......),并根据结果进行选择 - 记住要测试,配置文件并比较之后的实际页面加载时间。

My recommendation is to run the code you intend to compress through several compressors (an automated comparison tool such as CompressorRater helps...), and choose based on the results - remembering to test, profile and compare the actual page load times afterward.

这篇关于哪个javascript缩小库产生更好的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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