Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: sky/sdk/lib/widgets/widget.dart

Issue 1216973005: Turn off the code that is forcing stocksapp to build 50 times a second, and change the code that tr… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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?
}
}
« sky/sdk/example/stocks/lib/main.dart ('K') | « sky/sdk/example/stocks/lib/main.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698