From 07cfb8d524c47e03d3196ddaac8cb4dc2fbfd61e Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 24 May 2010 09:48:41 -0400 Subject: [PATCH] [perf] add tweener.framePrepareStart/Done events Add events when we start preparing a frame and finish preparing a frame. (In addition to measuring property-updating overhead, this allows us to see the interval between finishing preparing a frame and starting painting the frame, which is the relayout time.) https://bugzilla.gnome.org/show_bug.cgi?id=619515 --- js/ui/tweener.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/js/ui/tweener.js b/js/ui/tweener.js index 60aaa8d1f..f2e3b5385 100644 --- a/js/ui/tweener.js +++ b/js/ui/tweener.js @@ -4,6 +4,7 @@ const Clutter = imports.gi.Clutter; const GLib = imports.gi.GLib; const Lang = imports.lang; const Mainloop = imports.mainloop; +const Shell = imports.gi.Shell; const Signals = imports.signals; const Tweener = imports.tweener.tweener; @@ -221,6 +222,14 @@ ClutterFrameTicker.prototype = { function(timeline, frame) { this._onNewFrame(frame); })); + + let perf_log = Shell.PerfLog.get_default(); + perf_log.define_event("tweener.framePrepareStart", + "Start of a new animation frame", + ""); + perf_log.define_event("tweener.framePrepareDone", + "Finished preparing frame", + ""); }, _onNewFrame : function(frame) { @@ -233,8 +242,11 @@ ClutterFrameTicker.prototype = { this._startTime = this._timeline.get_elapsed_time(); // currentTime is in milliseconds + let perf_log = Shell.PerfLog.get_default(); this._currentTime = (this._timeline.get_elapsed_time() - this._startTime) / slowDownFactor; + perf_log.event("tweener.framePrepareStart"); this.emit('prepare-frame'); + perf_log.event("tweener.framePrepareDone"); }, getTime : function() {