Add more timeline ranges for profiling hot reload (#7792)

This commit is contained in:
Ian Hickson
2017-02-01 22:47:26 -08:00
committed by GitHub
parent 829976d35e
commit 648f70630c
2 changed files with 15 additions and 4 deletions

View File

@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'dart:developer';
import 'dart:ui' as ui show window;
import 'package:flutter/foundation.dart';
@@ -227,7 +228,12 @@ abstract class RendererBinding extends BindingBase implements SchedulerBinding,
@override
void reassembleApplication() {
super.reassembleApplication();
renderView.reassemble();
Timeline.startSync('Dirty Render Tree');
try {
renderView.reassemble();
} finally {
Timeline.finishSync();
}
handleBeginFrame(null);
}

View File

@@ -1873,9 +1873,14 @@ class BuildOwner {
///
/// This is expensive and should not be called except during development.
void reassemble(Element root) {
assert(root._parent == null);
assert(root.owner == this);
root._reassemble();
Timeline.startSync('Dirty Element Tree');
try {
assert(root._parent == null);
assert(root.owner == this);
root._reassemble();
} finally {
Timeline.finishSync();
}
}
}