TraceMonkey dramatically improves the speed of many JavaScript operations. (Click to enlarge.)
(Credit: Mozilla)
TraceMonkey 基于 trace tree 理论.是一种 JIT [Just In Time] 优化技术.简单地说,JIT 就是在“合适的时候”(也就是 Just In Time 的要义)将 JavaScript 编译为 native code 再来执行(Java 很早就已经采用 JIT 来提升性能了).而 trace tree 则对这些 native code 再做进一步的化,比如:优化函数调用,优化类型检测,优化循环,等等.据称,在多项性能测试之中,开启了这一特性之后,脚本的运行性能有了“惊人的”提升.