How Do I Measure the Performance of my AngularJS app's digest Cycle?

后端 未结 8 2492
说谎
说谎 2020-11-28 18:04

What is a simple way to measure the duration of the angularjs digest cycle? There exist various methods to analyze the performance of the digest cycle, however each comes wi

8条回答
  •  迷失自我
    2020-11-28 18:32

    Here's a secret. In the chrome dev tools, do a cpu profile run. After you have stopped capturing, at the bottom of the screen is a down triangle next to "Heavy (Bottom Up)". Click the triangle and select "Flame Chart". Once you are in Flame Chart mode, you can zoom and pan to see the digest cycles, how long they take, and exactly what functions are being called. The Flame Chart is so incredibly useful for tracking down page load issues, ng-repeat performance problems, digest cycle problems! I really don't know how I was able to debug and profile before the Flame Chart. Here is an example:

    Flame Chart in Chrome dev tools

提交回复
热议问题