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

后端 未结 8 2538
说谎
说谎 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:41

    One handy tool for keeping an eye on the digest cycle can be found via the excellent ng-stats tool by @kentcdodds. It creates a little visual element like so, and can even be implemented via bookmarklet. It can even be used inside of iFrames like jsfiddle.

    Little utility to show stats about your page's angular digest/watches. This library currently has a simple script to produce a chart (see below). It also creates a module called angularStats which has a directive called angular-stats which can be used to put angular stats on a specific place on the page that you specify.

    Found at https://github.com/kentcdodds/ng-stats

提交回复
热议问题