[PATCH] D64065: Skip test earlier if metric is not found in compare.py
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 04:06:30 PDT 2019
fhahn created this revision.
fhahn added reviewers: anemet, MatzeB, cmatthews, serge-sans-paille.
Herald added a project: LLVM.
This speeds up processing for inputs with lots of missing metrics, by
avoiding adding them to names.
Repository:
rT test-suite
https://reviews.llvm.org/D64065
Files:
utils/compare.py
Index: utils/compare.py
===================================================================
--- utils/compare.py
+++ utils/compare.py
@@ -25,6 +25,9 @@
print("%s: Could not find toplevel 'tests' key")
sys.exit(1)
for test in jsondata['tests']:
+ if "metrics" not in test:
+ print("Warning: '%s' has no metrics, skipping!" % test['name'])
+ continue
name = test.get("name")
if name is None:
sys.stderr.write("Error: Found unnamed test\n" % name)
@@ -33,9 +36,6 @@
sys.stderr.write("Error: Multiple tests with name '%s'\n" % name)
sys.exit(1)
names.add(name)
- if "metrics" not in test:
- print("Warning: '%s' has No metrics!" % test['name'])
- continue
for name in test["metrics"].keys():
if name not in columnindexes:
columnindexes[name] = len(columns)
@@ -50,15 +50,16 @@
data = []
testnames = []
for test in jsondata['tests']:
+ if "metrics" not in test:
+ continue
name = test['name']
if 'shortname' in test:
name = test['shortname']
testnames.append(name)
datarow = [nan] * len(columns)
- if "metrics" in test:
- for (metricname, value) in test['metrics'].items():
- datarow[columnindexes[metricname]] = value
+ for (metricname, value) in test['metrics'].items():
+ datarow[columnindexes[metricname]] = value
for (name, value) in test.items():
index = columnindexes.get(name)
if index is not None:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D64065.207509.patch
Type: text/x-patch
Size: 1658 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190702/3597eac9/attachment.bin>
More information about the llvm-commits
mailing list