测量 Firefox 扩展的性能
有没有一个工具可以测量我的 Firefox 扩展的性能?我的脚本的哪一部分占用大量 CPU 是否会造成影响?
Is there a tool to measure the performance of my firefox extension. And is there a toll which part of my script takes lot of CPU?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您似乎正在寻找 JavaScript 分析器。不幸的是,我不知道有什么好的分析器可以做到这一点。通常的推荐是 Firebug,但它不适用于附加组件(可能与 Chromebug但我对此不太确定)。还有 XUL 分析器,它已经过时,但可能仍然可以在较新的版本中使用Firefox 版本(您可以使用 插件兼容性Reporter 安装和测试不兼容的附加组件)。还有 JavaScript Deobfuscator ,它的用途不同,但可以做一些基本的分析,例如出色地。在那里,您可以调整过滤器以仅包含扩展程序的 JavaScript 文件,并查看正在调用的所有函数 - 以及调用次数和平均执行时间。有时这足以识别瓶颈。
You seem to be looking for a JavaScript profiler. Unfortunately, I don't know any good profilers for this. The usual recommendation would be Firebug but it doesn't work for add-ons (maybe with Chromebug but I'm not sure about that). There is also XUL profiler which is outdated but might still work in newer Firefox versions (you can use Add-on Compatibility Reporter to install and test incompatible add-ons). And there is JavaScript Deobfuscator which is meant for something different but can do some basic profiling as well. There you can adjust the filters to include only JavaScript files of your extension and see all the functions that are being called - along with the number of calls and the average execution time. This is sometimes good enough to identify the bottlenecks.