什么是个人资料JavaScript执行的最佳方法? [英] What is the best way to profile javascript execution?

查看:87
本文介绍了什么是个人资料JavaScript执行的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个良好分析器对JavaScript?我知道,萤火虫有分析code一些支持。但我想确定一个较长的规模统计。
想象一下,你正在建设一个大量的JavaScript code,并要确定实际是什么在code中的瓶颈。起初我想看到的每一个javascript函数和执行时间配置文件统计信息。下一步将包括DOM功能。这与行动结合起来,这会减慢速度像渲染的树操作将是完美的。我认为这将提供一个良好的IM pression如果表现在我的code杀害,在DOM preparation或更新渲染树/视频。

Is there a good profiler for javascript? I know that firebug has some support for profiling code. But I want to determine stats on a longer scale. Imagine you are building a lot of javascript code and you want to determine what are actually the bottlenecks in the code. At first I want to see profile stats of every javascript function and execution time. Next would be including DOM functions. This combined with actions that slows things down like operation on the rendering tree would be perfect. I think this would give a good impression if the performance is killed in my code, in DOM preparation or in updates to the rendering tree/visual.

有一些接近我想要什么?或者,这将是实现大多数我所描述什么是最好的工具?难道是一个自我编译器以及JavaScript引擎通过配置文件功能增强?

Is there something close to what I want? Or what would be the best tool to achieve the most of what I've described? Would it be a self compiled browser plus javascript engine enhanced by profile functionality?

推荐答案

萤火虫提供了一个非常详细的分析报告。它会告诉你每一个方法调用需要多长时间在一个巨大的(详细)表。

Firebug provides a highly detailed profiling report. It will tell you how long each method invocation takes in a giant (detailed) table.

console.profile([title])
//also see
console.trace()

您需要调用 console.profileEnd()来结束你的个人资料块。看到这里控制台API:<一href=\"http://getfirebug.com/wiki/index.php/Console_API\">http://getfirebug.com/wiki/index.php/Console_API

You need to call console.profileEnd () to end your profile block. See the console API here: http://getfirebug.com/wiki/index.php/Console_API

黑鸟也有一个简单的分析工具。

Blackbird also has a simpler profiler.

这篇关于什么是个人资料JavaScript执行的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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