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

Unified Diff: tools/skpbench/_benchresult.py

Issue 2378383002: skpbench: use accumulative result as the default (Closed)
Patch Set: Created 4 years, 3 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/skpbench/parseskpbench.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpbench/_benchresult.py
diff --git a/tools/skpbench/_benchresult.py b/tools/skpbench/_benchresult.py
index 32d760c57a37e0f82f30d6c4d4b4f8e8bc0be96e..94c110569cd738929ce9db6c0828993bfef1aa81 100644
--- a/tools/skpbench/_benchresult.py
+++ b/tools/skpbench/_benchresult.py
@@ -11,22 +11,22 @@ import sys
class BenchResult:
FLOAT_REGEX = '[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?'
- PATTERN = re.compile('^(?P<median_pad> *)'
- '(?P<median>' + FLOAT_REGEX + ')'
- '(?P<accum_pad> +)'
+ PATTERN = re.compile('^(?P<accum_pad> *)'
'(?P<accum>' + FLOAT_REGEX + ')'
+ '(?P<median_pad> +)'
+ '(?P<median>' + FLOAT_REGEX + ')'
'(?P<max_pad> +)'
'(?P<max>' + FLOAT_REGEX + ')'
'(?P<min_pad> +)'
'(?P<min>' + FLOAT_REGEX + ')'
'(?P<stddev_pad> +)'
'(?P<stddev>' + FLOAT_REGEX + '%)'
- '(?P<metric_pad> +)'
- '(?P<metric>ms|fps)'
'(?P<samples_pad> +)'
'(?P<samples>\d+)'
'(?P<sample_ms_pad> +)'
'(?P<sample_ms>\d+)'
+ '(?P<metric_pad> +)'
+ '(?P<metric>ms|fps)'
'(?P<config_pad> +)'
'(?P<config>[^\s]+)'
'(?P<bench_pad> +)'
@@ -38,14 +38,14 @@ class BenchResult:
return cls(match) if match else None
def __init__(self, match):
- self.median = float(match.group('median'))
self.accum = float(match.group('accum'))
+ self.median = float(match.group('median'))
self.max = float(match.group('max'))
self.min = float(match.group('min'))
self.stddev = float(match.group('stddev')[:-1]) # Drop '%' sign.
- self.metric = match.group('metric')
self.samples = int(match.group('samples'))
self.sample_ms = int(match.group('sample_ms'))
+ self.metric = match.group('metric')
self.config = match.group('config')
self.bench = match.group('bench')
self._match = match
@@ -58,8 +58,8 @@ class BenchResult:
print(self._match.group(0), file=outfile)
else:
values = list()
- for name in ['median', 'accum', 'max', 'min', 'stddev',
- 'metric', 'samples', 'sample_ms', 'config']:
+ for name in ['accum', 'median', 'max', 'min', 'stddev',
+ 'samples', 'sample_ms', 'metric', 'config']:
values.append(self.get_string(name + '_pad'))
values.append(self.get_string(name))
values.append(config_suffix)
« no previous file with comments | « no previous file | tools/skpbench/parseskpbench.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698