Chromium Code Reviews| Index: sky/sdk/lib/widgets/widget.dart |
| diff --git a/sky/sdk/lib/widgets/widget.dart b/sky/sdk/lib/widgets/widget.dart |
| index 2d48825eed853e2942464f5a5bba9ba9e0eb7288..ebecd821318de476cf42d006966052b2b5443d97 100644 |
| --- a/sky/sdk/lib/widgets/widget.dart |
| +++ b/sky/sdk/lib/widgets/widget.dart |
| @@ -512,6 +512,8 @@ Set<Component> _dirtyComponents = new Set<Component>(); |
| bool _buildScheduled = false; |
| bool _inRenderDirtyComponents = false; |
| +List<int> _debugFrameTimes = <int>[]; |
| + |
| void _buildDirtyComponents() { |
| Stopwatch sw; |
| if (_shouldLogRenderDuration) |
| @@ -538,7 +540,13 @@ void _buildDirtyComponents() { |
| if (_shouldLogRenderDuration) { |
| sw.stop(); |
| - print('Render took ${sw.elapsedMicroseconds} microseconds'); |
| + _debugFrameTimes.add(sw.elapsedMicroseconds); |
| + if (_debugFrameTimes.length >= 1000) { |
| + _debugFrameTimes.sort(); |
| + const int i = 99; |
| + print('_buildDirtyComponents: ${i+1}th fastest frame out of the last ${_debugFrameTimes.length}: ${_debugFrameTimes[i]} microseconds'); |
| + _debugFrameTimes.clear(); |
| + } |
|
abarth-chromium
2015/06/29 22:39:57
Did you mean to check this in?
|
| } |
| } |