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

Unified Diff: third_party/WebKit/PerformanceTests/resources/runner.js

Issue 2559893002: Force GC in different ways for different measurements in blink_perf tests (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/PerformanceTests/resources/runner.js
diff --git a/third_party/WebKit/PerformanceTests/resources/runner.js b/third_party/WebKit/PerformanceTests/resources/runner.js
index 632287a68fc65224d5f0b5adee4ca133c0a0f055..10b23b58e5d2dd9ce4f36ebe896035e049d174f7 100644
--- a/third_party/WebKit/PerformanceTests/resources/runner.js
+++ b/third_party/WebKit/PerformanceTests/resources/runner.js
@@ -164,7 +164,6 @@ if (window.testRunner) {
}
function scheduleNextRun(scheduler, runner) {
- PerfTestRunner.gc();
scheduler(function () {
try {
if (currentTest.setup)
@@ -248,6 +247,9 @@ if (window.testRunner) {
PerfTestRunner.measureFrameTime = function (test) {
PerfTestRunner.unit = "ms";
PerfTestRunner.bufferedLog = true;
+ // Force gc before starting the test to avoid the measured time from
+ // being affected by gc performance. See crbug.com/667811#c16.
+ PerfTestRunner.gc();
start(test, requestAnimationFrame, measureFrameTimeOnce);
}
@@ -278,6 +280,9 @@ if (window.testRunner) {
}
function measureTimeOnce() {
+ // Force gc before measuring time to avoid interference between tests.
+ PerfTestRunner.gc();
+
var start = PerfTestRunner.now();
var returnValue = currentTest.run();
var end = PerfTestRunner.now();
@@ -312,6 +317,9 @@ if (window.testRunner) {
}
function callRunAndMeasureTime(callsPerIteration) {
+ // Force gc before measuring time to avoid interference between tests.
+ PerfTestRunner.gc();
+
var startTime = PerfTestRunner.now();
for (var i = 0; i < callsPerIteration; i++)
currentTest.run();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698