如何衡量绑定/呈现视图或指令的时间? [英] How to measure the time to bind/render a view or directive?
问题描述
我有一个包含两个指令的视图。我想知道更新/绑定/显示每个部分需要多长时间(视图,第一个指令和另一个指令)。
I have a view that contains two directives. I want to know how much time it takes to update/bind/display each part (the view, the first directive and the other directive).
我正在寻找端到端的持续时间,包括在JS中花费的时间和实际的浏览器渲染时间;
I'm looking for an end-to-end duration, including the time spent in JS and the actual browser rendering time;
我知道Batarang有助于测量手表
但是我在这里看大图。
I know Batarang helps measuring watches
but here I'm looking at the bigger picture.
在Chrome中,我启动了CPU配置文件并点击刷新。在Flame Chart视图中,我看到范围。$ digest
花了91毫秒。但那是包括指令在内的整个观点吗?这包括浏览器渲染时间吗?
In Chrome, I started a CPU Profile and hit refresh. In the Flame Chart view, I see that scope.$digest
took 91 ms. But that's for the whole view including the directives right? And does that include browser rendering time?
我不介意在这里和那里插入一些 console.log
在AngularJS源代码中做到这一点。
I don't mind inserting a few console.log
here and there in the AngularJS source code to do that.
推荐答案
我可能会因为这样说而失去名声:)让希望不要 - 但是最新的IE11开发工具既有用于脚本的分析器,也有用于渲染的UI响应选项卡。
I'll probably lose reputation for saying this :) lets hope not - but the latest IE11 dev tools have both a profiler for scripts, and UI responsiveness tabs for rendering.
使用IE进行互联网开发有点奇怪,但开发工具有非常好 - 它已经采取了一些适应性从铬转换,但它同样有用且非常高效。
It's a little bit odd using IE for internet dev, but the dev tools have been really good - it has taken some adapting to switch from chrome, but it's just as useful and quite performant.
概要概述以及如何使用它,以及追踪特定的应用领域是 http:/ /msdn.microsoft.com/en-us/library/ie/dn255009(v=vs.85).aspx
An overview of the profile and how to use it, and track down specific app areas is at http://msdn.microsoft.com/en-us/library/ie/dn255009(v=vs.85).aspx
这篇关于如何衡量绑定/呈现视图或指令的时间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!