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

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

Issue 1195113002: Improve stocks2 performance (Closed) Base URL: git@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
« no previous file with comments | « sky/sdk/lib/rendering/paragraph.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/widgets/widget.dart
diff --git a/sky/sdk/lib/widgets/widget.dart b/sky/sdk/lib/widgets/widget.dart
index 4ad23dc9787f4c62beadcbf2ab0ed9c1c8f00c28..57f5c16bb276e971a6f6f8e2c128a7fe26c2b48d 100644
--- a/sky/sdk/lib/widgets/widget.dart
+++ b/sky/sdk/lib/widgets/widget.dart
@@ -57,6 +57,7 @@ abstract class Widget {
static void _notifyMountStatusChanged() {
try {
+ sky.tracing.begin("Widget._notifyMountStatusChanged");
_notifyingMountStatus = true;
for (Widget node in _mountedChanged) {
if (node._wasMounted != node._mounted) {
@@ -70,6 +71,7 @@ abstract class Widget {
_mountedChanged.clear();
} finally {
_notifyingMountStatus = false;
+ sky.tracing.end("Widget._notifyMountStatusChanged");
}
}
void didMount() { }
@@ -434,13 +436,12 @@ bool _buildScheduled = false;
bool _inRenderDirtyComponents = false;
void _buildDirtyComponents() {
- //_tracing.begin('fn::_buildDirtyComponents');
-
Stopwatch sw;
if (_shouldLogRenderDuration)
sw = new Stopwatch()..start();
try {
+ sky.tracing.begin('Widgets._buildDirtyComponents');
_inRenderDirtyComponents = true;
List<Component> sortedDirtyComponents = _dirtyComponents.toList();
@@ -453,6 +454,7 @@ void _buildDirtyComponents() {
_buildScheduled = false;
} finally {
_inRenderDirtyComponents = false;
+ sky.tracing.end('Widgets._buildDirtyComponents');
}
Widget._notifyMountStatusChanged();
@@ -461,8 +463,6 @@ void _buildDirtyComponents() {
sw.stop();
print('Render took ${sw.elapsedMicroseconds} microseconds');
}
-
- //_tracing.end('fn::_buildDirtyComponents');
}
void _scheduleComponentForRender(Component c) {
@@ -736,8 +736,12 @@ abstract class MultiChildRenderObjectWrapper extends RenderObjectWrapper {
assert(old.root is ContainerRenderObjectMixin);
assert(oldNode.root != null);
- (old.root as ContainerRenderObjectMixin).remove(oldNode.root); // TODO(ianh): Remove cast once the analyzer is cleverer
- root.add(oldNode.root, before: nextSibling);
+ if (old.root == root) {
+ root.move(oldNode.root, before: nextSibling);
+ } else {
+ (old.root as ContainerRenderObjectMixin).remove(oldNode.root); // TODO(ianh): Remove cast once the analyzer is cleverer
+ root.add(oldNode.root, before: nextSibling);
+ }
return true;
}
« no previous file with comments | « sky/sdk/lib/rendering/paragraph.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698