DOM/DOMDivWalk.html result is unreliable
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 03:59:37 +0000 (03:59 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jan 2012 03:59:37 +0000 (03:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=77313

Reviewed by Adam Birth.

Trigger garbage collection manually between test runs to avoid GC
to occur in the middle of runs.

* DOM/resources/dom-perf.js:
(BenchmarkSuite.prototype.RunSingle):
* resources/runner.js:
(gc.else.gcRec):
(gc):
(runLoop):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@106211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/ChangeLog
PerformanceTests/DOM/resources/dom-perf.js
PerformanceTests/resources/runner.js

index c250215..c3a2c84 100644 (file)
@@ -1,3 +1,20 @@
+2012-01-29  Ryosuke Niwa  <rniwa@webkit.org>
+
+        DOM/DOMDivWalk.html result is unreliable
+        https://bugs.webkit.org/show_bug.cgi?id=77313
+
+        Reviewed by Adam Birth.
+
+        Trigger garbage collection manually between test runs to avoid GC
+        to occur in the middle of runs.
+
+        * DOM/resources/dom-perf.js:
+        (BenchmarkSuite.prototype.RunSingle):
+        * resources/runner.js:
+        (gc.else.gcRec):
+        (gc):
+        (runLoop):
+
 2012-01-26  Ryosuke Niwa  <rniwa@webkit.org>
 
         Import Chromium's dom_perf test
index 2cc4e08..c892836 100644 (file)
@@ -284,6 +284,8 @@ BenchmarkSuite.prototype.RunSingle = function(benchmark, times) {
             this.benchmarkContentHolder.removeChild(this.benchmarkContent);
         this.benchmarkContent = this.benchmarkContentProto.cloneNode();
         this.benchmarkContentHolder.appendChild(this.benchmarkContent);
+        gc();
+
         try {
             if (benchmark.setup) {
                 if (!setupReturn || !benchmark.shareSetup)
index 155453d..fb479e4 100644 (file)
@@ -72,9 +72,26 @@ function logStatistics(times) {
     log("max " + computeMax(times));
 }
 
+function gc() {
+    if (window.GCController)
+        GCController.collect();
+    else {
+        function gcRec(n) {
+            if (n < 1)
+                return {};
+            var temp = {i: "ab" + i + (i / 100000)};
+            temp += "foo";
+            gcRec(n-1);
+        }
+        for (var i = 0; i < 1000; i++)
+            gcRec(10);
+    }
+}
+
 function runLoop()
 {
     if (window.completedRuns < window.runCount) {
+        gc();
         window.setTimeout(run, 0);
     } else {
         logStatistics(times);