From cd8bf92832a17f2f09715907ff910e01bc4e7abd Mon Sep 17 00:00:00 2001 From: Philip Peitsch Date: Tue, 6 May 2014 15:03:05 +1000 Subject: [PATCH] Suppress manual task processing to prevent skewing of benchmark figures Manually processing the redraw tasks vastly affects the current benchmark results, dwarfing impacts from most other subsystems. Disabling this for now to aid tuning of non-UI components. --- programs/benchmark/js/Benchmark.js | 2 ++ webodf/lib/core/Task.js | 12 +++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/programs/benchmark/js/Benchmark.js b/programs/benchmark/js/Benchmark.js index cb25e16f..5045121b 100644 --- a/programs/benchmark/js/Benchmark.js +++ b/programs/benchmark/js/Benchmark.js @@ -40,6 +40,7 @@ define(["OdfBenchmarkContext"], function(OdfBenchmarkContext) { "use strict"; runtime.loadClass("core.EventNotifier"); + runtime.loadClass("core.Task"); runtime.loadClass("odf.OdfCanvas"); /** @@ -80,6 +81,7 @@ define(["OdfBenchmarkContext"], function(OdfBenchmarkContext) { }); events.emit("start", {}); + core.Task.SUPPRESS_MANUAL_PROCESSING = true; context.odfCanvas = new odf.OdfCanvas(canvasElement); currentActionIndex = -1; executeNextAction(); diff --git a/webodf/lib/core/Task.js b/webodf/lib/core/Task.js index 3b13b7f4..fe78bc5e 100644 --- a/webodf/lib/core/Task.js +++ b/webodf/lib/core/Task.js @@ -90,6 +90,14 @@ */ core.Task = {}; + /** + * Disable manually processing of tasks when core.Task.processTasks is called. + * This is only used during benchmarks to prevent caret redraws from skewing + * the resulting numbers + * @type {!boolean} + */ + core.Task.SUPPRESS_MANUAL_PROCESSING = false; + /** * Process any outstanding redraw tasks that may be queued up * waiting for an animation frame @@ -97,7 +105,9 @@ * @return {undefined} */ core.Task.processTasks = function() { - redrawTasks.performRedraw(); + if (!core.Task.SUPPRESS_MANUAL_PROCESSING) { + redrawTasks.performRedraw(); + } }; /**