JavaScript 基准测试/分析
我目前正在研究根据运行时行为对 javascript 代码进行分析/基准测试的可能性。我知道如果你在浏览器中运行代码,有一些不错的工具(firebug、chrome 开发工具等),但我正在寻找一种可以自动化测试的方法。 如果可能的话,我想将性能测试(例如某些函数/代码块的执行时间)集成到 CI 周期中。此外,我想收集有关内存分配的运行时信息。
目前,我通过手动添加跟踪代码来跟踪函数/代码块的执行时间。有人实施了更好的解决方案来做到这一点吗?你如何分析/基准测试你的 JS 代码?
请与我分享您的经验! 谢谢
i am currently investigating possibilities for profiling/benchmarking javascript code in terms of runtime behavior. I know that there are some decent tools if you run the code in your browser (firebug, chrome dev-tools, etc.), but I am looking for a method that can be automated for testing.
If possible, I would like to integrate performance tests (e.g. execution time of certain functions/code blocks) into a CI cycle. Additionally, i would like to collect runtime information about memory allocations.
Currently i track the execution time of functions/code blocks by adding tracking-code by hand. Has anybody implemented a better solution to do this? How do you profile/benchmark your JS code?
Please share your experience with me!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
John Resig 在 2009 年撰写了一篇关于一个免费工具的文章,该工具可以分析 IE(以及现在 Firefox 也一样)详细说明。据供应商称,高级版本还与 Selenium 集成并支持 Web 驱动程序脚本。
John Resig wrote in 2009 about a free tool that profiles IE (and now Firefox, too) in detail. According to the vendor the Premium Version also integrates with Selenium and supports Web Driver scripts.