mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
Merge pull request #1033 from SpecLad:xls++
This commit is contained in:
commit
e3ae36dcb3
@ -4,6 +4,7 @@ from __future__ import division
|
|||||||
|
|
||||||
import ast
|
import ast
|
||||||
import logging
|
import logging
|
||||||
|
import numbers
|
||||||
import os, os.path
|
import os, os.path
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -52,8 +53,7 @@ def collect_xml(collection, configuration, xml_fullname):
|
|||||||
|
|
||||||
for test in sorted(parseLogFile(xml_fullname)):
|
for test in sorted(parseLogFile(xml_fullname)):
|
||||||
test_results = module_tests.setdefault((test.shortName(), test.param()), {})
|
test_results = module_tests.setdefault((test.shortName(), test.param()), {})
|
||||||
if test.status == 'run':
|
test_results[configuration] = test.get("gmean") if test.status == 'run' else test.status
|
||||||
test_results[configuration] = test.get("gmean")
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
arg_parser = ArgumentParser(description='Build an XLS performance report.')
|
arg_parser = ArgumentParser(description='Build an XLS performance report.')
|
||||||
@ -79,7 +79,7 @@ def main():
|
|||||||
sheet_conf = ast.literal_eval(sheet_conf_file.read())
|
sheet_conf = ast.literal_eval(sheet_conf_file.read())
|
||||||
except Exception:
|
except Exception:
|
||||||
sheet_conf = {}
|
sheet_conf = {}
|
||||||
logging.debug('no sheet.conf for {}'.format(sheet_path))
|
logging.debug('no sheet.conf for %s', sheet_path)
|
||||||
|
|
||||||
sheet_conf = dict(global_conf.items() + sheet_conf.items())
|
sheet_conf = dict(global_conf.items() + sheet_conf.items())
|
||||||
|
|
||||||
@ -90,14 +90,14 @@ def main():
|
|||||||
config_names = [p for p in os.listdir(sheet_path)
|
config_names = [p for p in os.listdir(sheet_path)
|
||||||
if os.path.isdir(os.path.join(sheet_path, p))]
|
if os.path.isdir(os.path.join(sheet_path, p))]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.warning(e)
|
logging.warning('error while determining configuration names for %s: %s', sheet_path, e)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
collection = {}
|
collection = {}
|
||||||
|
|
||||||
for configuration, configuration_path in \
|
for configuration, configuration_path in \
|
||||||
[(c, os.path.join(sheet_path, c)) for c in config_names]:
|
[(c, os.path.join(sheet_path, c)) for c in config_names]:
|
||||||
logging.info('processing {}'.format(configuration_path))
|
logging.info('processing %s', configuration_path)
|
||||||
for xml_fullname in glob(os.path.join(configuration_path, '*.xml')):
|
for xml_fullname in glob(os.path.join(configuration_path, '*.xml')):
|
||||||
collect_xml(collection, configuration, xml_fullname)
|
collect_xml(collection, configuration, xml_fullname)
|
||||||
|
|
||||||
@ -117,7 +117,7 @@ def main():
|
|||||||
|
|
||||||
for i, caption in enumerate(['Module', 'Test', 'Image\nsize', 'Data\ntype', 'Parameters']
|
for i, caption in enumerate(['Module', 'Test', 'Image\nsize', 'Data\ntype', 'Parameters']
|
||||||
+ config_names + [None]
|
+ config_names + [None]
|
||||||
+ [comp['from'] + '\nvs\n' + comp['to'] for comp in sheet_comparisons]):
|
+ [comp['to'] + '\nvs\n' + comp['from'] for comp in sheet_comparisons]):
|
||||||
sheet.row(0).write(i, caption, header_style)
|
sheet.row(0).write(i, caption, header_style)
|
||||||
|
|
||||||
row = 1
|
row = 1
|
||||||
@ -143,13 +143,13 @@ def main():
|
|||||||
sheet.write(row, 5 + i, None, no_time_style)
|
sheet.write(row, 5 + i, None, no_time_style)
|
||||||
|
|
||||||
for i, comp in enumerate(sheet_comparisons):
|
for i, comp in enumerate(sheet_comparisons):
|
||||||
left = configs.get(comp["from"])
|
cmp_from = configs.get(comp["from"])
|
||||||
right = configs.get(comp["to"])
|
cmp_to = configs.get(comp["to"])
|
||||||
col = 5 + len(config_names) + 1 + i
|
col = 5 + len(config_names) + 1 + i
|
||||||
|
|
||||||
if left is not None and right is not None:
|
if isinstance(cmp_from, numbers.Number) and isinstance(cmp_to, numbers.Number):
|
||||||
try:
|
try:
|
||||||
speedup = left / right
|
speedup = cmp_from / cmp_to
|
||||||
sheet.write(row, col, speedup, good_speedup_style if speedup > 1.1 else
|
sheet.write(row, col, speedup, good_speedup_style if speedup > 1.1 else
|
||||||
bad_speedup_style if speedup < 0.9 else
|
bad_speedup_style if speedup < 0.9 else
|
||||||
speedup_style)
|
speedup_style)
|
||||||
|
Loading…
Reference in New Issue
Block a user