简体   繁体   English

JavaScript优化脚本?

[英]JavaScript Optimization Script?

I seem to recall an online script that refactors JavaScript for the purpose of optimization (ie, make it run faster). 我似乎想起了一个在线脚本,该脚本出于优化目的重构了JavaScript(即,使其运行得更快)。

I am not asking for a link nor information pertaining 'minifying' the code (and in broader terms, I am not talking about the load time for JavaScript). 既不需要链接,也不需要有关“最小化”代码的信息(更广泛地说,我不是在谈论JavaScript的加载时间)。 I am asking if there is a script that optimizes a JavaScript program. 我在问是否有一个脚本可以优化 JavaScript程序。

I am under the impression that good C compilers optimize code, so it seems that some methodology would have came to be for optimizing JavaScript over the years. 我的印象是优秀的C编译器可以优化代码,因此,多年来看来似乎有些方法可以用来优化JavaScript。 Is there such a service? 有这样的服务吗? And does such a service exist that is similar to 'minify' in the sense that it is an online service that you feed your JavaScript code in - and it spits out the optimized version? 在提供JavaScript代码的在线服务中,是否存在类似于“最小化”的服务-它会吐出优化版本?

No there are no javascript programs that optimize the code in sense of algorithmic optimize. 没有,没有从算法优化的意义上优化代码的javascript程序。 Unlike compilers that do complex calculation base on information theory (they eliminates unnecessary loops, removes not used variables.....a lot of things) for optimizing the final machine code, Javascript is an interpreted(on the fly) language, and it's optimization is done by the javascript engine of the browser. 与基于信息论进行复杂计算的编译器(它们消除了不必要的循环,去除了未使用的变量.....很多东西)以优化最终机器代码不同,Javascript是一种解释型(即时)语言,它是优化是由浏览器的javascript引擎完成的。 Actually Google Chrome javascript engine seems to be the fast. 实际上,谷歌浏览器javascript引擎似乎是最快的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM