Title: [100313] trunk/PerformanceTests/SunSpider
Revision
100313
Author
[email protected]
Date
2011-11-15 13:03:52 -0800 (Tue, 15 Nov 2011)

Log Message

Extend sunspider driver to be able to run kraken
https://bugs.webkit.org/show_bug.cgi?id=71799

Patch by Andy Wingo <[email protected]> on 2011-11-15
Reviewed by Filip Pizlo.

* resources/sunspider-standalone-driver.js: Try to load a -data
file.  If that succeeds, we have a kraken-like test, so we time
the test using `load'.  Otherwise fall back to using `run'.

Modified Paths

Diff

Modified: trunk/PerformanceTests/SunSpider/ChangeLog (100312 => 100313)


--- trunk/PerformanceTests/SunSpider/ChangeLog	2011-11-15 20:43:24 UTC (rev 100312)
+++ trunk/PerformanceTests/SunSpider/ChangeLog	2011-11-15 21:03:52 UTC (rev 100313)
@@ -1,3 +1,14 @@
+2011-11-15  Andy Wingo  <[email protected]>
+
+        Extend sunspider driver to be able to run kraken
+        https://bugs.webkit.org/show_bug.cgi?id=71799
+
+        Reviewed by Filip Pizlo.
+
+        * resources/sunspider-standalone-driver.js: Try to load a -data
+        file.  If that succeeds, we have a kraken-like test, so we time
+        the test using `load'.  Otherwise fall back to using `run'.
+
 2011-08-11  Mark Rowe  <[email protected]>
 
         Fix sunspider-compare-results to default to the same suite version as the sunspider script.

Modified: trunk/PerformanceTests/SunSpider/resources/sunspider-standalone-driver.js (100312 => 100313)


--- trunk/PerformanceTests/SunSpider/resources/sunspider-standalone-driver.js	2011-11-15 20:43:24 UTC (rev 100312)
+++ trunk/PerformanceTests/SunSpider/resources/sunspider-standalone-driver.js	2011-11-15 21:03:52 UTC (rev 100313)
@@ -32,12 +32,28 @@
 times.length = tests.length;
 
 for (var j = 0; j < tests.length; j++) {
-    var testName = suitePath + "/" + tests[j] + ".js";
-    var startTime = new Date;
-    if (testName.indexOf('parse-only') >= 0)
+    var testBase = suitePath + "/" + tests[j];
+    var testName = testBase + ".js";
+    var testData = testBase + "-data.js";
+
+    if (testName.indexOf('parse-only') >= 0) {
         times[j] = checkSyntax(testName);
-    else
-        times[j] = run(testName);
+    } else {
+        // Tests may or may not have associated -data files whose loading
+        // should not be timed.
+        try {
+            load(testData);
+            // If a file does have test data, then we can't use the
+            // higher-precision `run' timer, because `run' uses a fresh
+            // global environment, so we fall back to `load'.
+            var startTime = new Date;
+            load(testName);
+            times[j] = new Date() - startTime;
+        } catch (e) {
+            // No test data, just use `run'.
+            times[j] = run(testName);
+        }
+    }
     gc();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to