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

Unified Diff: Source/devtools/front_end/timeline/TracingTimelineModel.js

Issue 465223002: [ Do not submit ] Prototype for invalidation analysis Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleanup Created 6 years, 4 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 | « Source/core/dom/Node.cpp ('k') | Source/devtools/front_end/timeline/TracingTimelineUIUtils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/timeline/TracingTimelineModel.js
diff --git a/Source/devtools/front_end/timeline/TracingTimelineModel.js b/Source/devtools/front_end/timeline/TracingTimelineModel.js
index dc5c411333ae6b44c981c055bc47641709e5e004..353fea734dc4d3b1cc2dc557b5938e543b006fd4 100644
--- a/Source/devtools/front_end/timeline/TracingTimelineModel.js
+++ b/Source/devtools/front_end/timeline/TracingTimelineModel.js
@@ -31,6 +31,7 @@ WebInspector.TracingTimelineModel.RecordType = {
ActivateLayerTree: "ActivateLayerTree",
DrawFrame: "DrawFrame",
ScheduleStyleRecalculation: "ScheduleStyleRecalculation",
+ Invalidation: "Invalidation",
RecalculateStyles: "RecalculateStyles",
InvalidateLayout: "InvalidateLayout",
Layout: "Layout",
@@ -138,6 +139,8 @@ WebInspector.TracingTimelineModel.prototype = {
disabledByDefault("devtools.timeline.picture"),
disabledByDefault("blink.graphics_context_annotations")]);
}
+ // FIXME: Do not always enable this expensive category for invalidations.
+ categoriesArray.push(disabledByDefault("devtools.timeline.invalidations"));
var categories = categoriesArray.join(",");
this._startRecordingWithCategories(categories);
},
@@ -366,6 +369,7 @@ WebInspector.TracingTimelineModel.prototype = {
this._sendRequestEvents = {};
this._timerEvents = {};
this._requestAnimationFrameEvents = {};
+ this._invalidations = {};
this._layoutInvalidate = {};
this._lastScheduleStyleRecalculation = {};
this._webSocketCreateEvents = {};
@@ -476,6 +480,19 @@ WebInspector.TracingTimelineModel.prototype = {
this._lastRecalculateStylesEvent = event;
break;
+ case recordTypes.Invalidation:
+ var layoutInitator = event;
+ var frameId = event.args.data.frame;
+ var rootNode = event.args.data.root_node;
+ var styleChange = event.args.data.styleChange;
+
+ var invalidationString = rootNode + " was invalidated with " + styleChange;
+ if (this._invalidations[frameId] === undefined)
+ this._invalidations[frameId] = [invalidationString];
+ else
+ this._invalidations[frameId].push(invalidationString);
+ break;
+
case recordTypes.InvalidateLayout:
// Consider style recalculation as a reason for layout invalidation,
// but only if we had no earlier layout invalidation records.
@@ -489,9 +506,11 @@ WebInspector.TracingTimelineModel.prototype = {
case recordTypes.Layout:
var frameId = event.args["beginData"]["frame"];
event.initiator = this._layoutInvalidate[frameId];
+ event.invalidations = this._invalidations[frameId] ? this._invalidations[frameId].join('<br>') : 'No invalidations';
kouhei (in TOK) 2014/08/13 16:32:14 I'm wondering how well we should track the flow of
event.backendNodeId = event.args["endData"]["rootNode"];
event.highlightQuad = event.args["endData"]["root"];
this._layoutInvalidate[frameId] = null;
+ this._invalidations[frameId] = undefined;
if (this._currentScriptEvent)
event.warning = WebInspector.UIString("Forced synchronous layout is a possible performance bottleneck.");
break;
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/devtools/front_end/timeline/TracingTimelineUIUtils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698