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

Unified Diff: tools/run_benchmarks.py

Issue 395633012: Allow benchmarks to provide the standard deviation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Review Created 6 years, 5 months 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 | tools/unittests/run_benchmarks_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/run_benchmarks.py
diff --git a/tools/run_benchmarks.py b/tools/run_benchmarks.py
index 1a07025f07d61a9890bfd146625e982fb8f340f0..4c72eeb8679e8102d8315aa251ba8c33b151f1c7 100755
--- a/tools/run_benchmarks.py
+++ b/tools/run_benchmarks.py
@@ -156,6 +156,7 @@ class DefaultSentinel(Node):
self.flags = []
self.resources = []
self.results_regexp = None
+ self.stddev_regexp = None
self.units = "score"
@@ -196,6 +197,13 @@ class Graph(Node):
regexp_default = None
self.results_regexp = suite.get("results_regexp", regexp_default)
+ # A similar regular expression for the standard deviation (optional).
+ if parent.stddev_regexp:
+ stddev_default = parent.stddev_regexp % suite["name"]
+ else:
+ stddev_default = None
+ self.stddev_regexp = suite.get("stddev_regexp", stddev_default)
+
class Trace(Graph):
"""Represents a leaf in the benchmark suite tree structure.
@@ -207,6 +215,7 @@ class Trace(Graph):
assert self.results_regexp
self.results = []
self.errors = []
+ self.stddev = ""
def ConsumeOutput(self, stdout):
try:
@@ -216,11 +225,22 @@ class Trace(Graph):
self.errors.append("Regexp \"%s\" didn't match for benchmark %s."
% (self.results_regexp, self.graphs[-1]))
+ try:
+ if self.stddev_regexp and self.stddev:
+ self.errors.append("Benchmark %s should only run once since a stddev "
+ "is provided by the benchmark." % self.graphs[-1])
+ if self.stddev_regexp:
+ self.stddev = re.search(self.stddev_regexp, stdout, re.M).group(1)
+ except:
+ self.errors.append("Regexp \"%s\" didn't match for benchmark %s."
+ % (self.stddev_regexp, self.graphs[-1]))
+
def GetResults(self):
return Results([{
"graphs": self.graphs,
"units": self.units,
"results": self.results,
+ "stddev": self.stddev,
}], self.errors)
« no previous file with comments | « no previous file | tools/unittests/run_benchmarks_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698