perf report: summary.py: added --progress mode
This commit is contained in:
parent
70a4de20d7
commit
c1541c9e79
@ -39,6 +39,7 @@ if __name__ == "__main__":
|
|||||||
parser.add_option("", "--no-relatives", action="store_false", dest="calc_relatives", default=True, help="do not output relative values")
|
parser.add_option("", "--no-relatives", action="store_false", dest="calc_relatives", default=True, help="do not output relative values")
|
||||||
parser.add_option("", "--with-cycles-reduction", action="store_true", dest="calc_cr", default=False, help="output cycle reduction percentages")
|
parser.add_option("", "--with-cycles-reduction", action="store_true", dest="calc_cr", default=False, help="output cycle reduction percentages")
|
||||||
parser.add_option("", "--with-score", action="store_true", dest="calc_score", default=False, help="output automatic classification of speedups")
|
parser.add_option("", "--with-score", action="store_true", dest="calc_score", default=False, help="output automatic classification of speedups")
|
||||||
|
parser.add_option("", "--progress", action="store_true", dest="progress_mode", default=False, help="enable progress mode")
|
||||||
parser.add_option("", "--show-all", action="store_true", dest="showall", default=False, help="also include empty and \"notrun\" lines")
|
parser.add_option("", "--show-all", action="store_true", dest="showall", default=False, help="also include empty and \"notrun\" lines")
|
||||||
parser.add_option("", "--match", dest="match", default=None)
|
parser.add_option("", "--match", dest="match", default=None)
|
||||||
parser.add_option("", "--match-replace", dest="match_replace", default="")
|
parser.add_option("", "--match-replace", dest="match_replace", default="")
|
||||||
@ -108,11 +109,9 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
# build table
|
# build table
|
||||||
getter = metrix_table[options.metric][1]
|
getter = metrix_table[options.metric][1]
|
||||||
getter_score = metrix_table["score"][1]
|
getter_score = metrix_table["score"][1] if options.calc_score else None
|
||||||
if options.calc_relatives:
|
getter_p = metrix_table[options.metric + "%"][1] if options.calc_relatives else None
|
||||||
getter_p = metrix_table[options.metric + "%"][1]
|
getter_cr = metrix_table[options.metric + "$"][1] if options.calc_cr else None
|
||||||
if options.calc_cr:
|
|
||||||
getter_cr = metrix_table[options.metric + "$"][1]
|
|
||||||
tbl = table(metrix_table[options.metric][0])
|
tbl = table(metrix_table[options.metric][0])
|
||||||
|
|
||||||
# header
|
# header
|
||||||
@ -125,17 +124,20 @@ if __name__ == "__main__":
|
|||||||
if options.calc_cr:
|
if options.calc_cr:
|
||||||
i = 1
|
i = 1
|
||||||
for set in metric_sets:
|
for set in metric_sets:
|
||||||
tbl.newColumn(str(i) + "$", getSetName(set, i, options.columns) + "\nvs\n" + getSetName(test_sets[0], 0, options.columns) + "\n(cycles reduction)", align = "center", cssclass = "col_cr")
|
reference = getSetName(test_sets[0], 0, options.columns) if not options.progress_mode else 'previous'
|
||||||
|
tbl.newColumn(str(i) + "$", getSetName(set, i, options.columns) + "\nvs\n" + reference + "\n(cycles reduction)", align = "center", cssclass = "col_cr")
|
||||||
i += 1
|
i += 1
|
||||||
if options.calc_relatives:
|
if options.calc_relatives:
|
||||||
i = 1
|
i = 1
|
||||||
for set in metric_sets:
|
for set in metric_sets:
|
||||||
tbl.newColumn(str(i) + "%", getSetName(set, i, options.columns) + "\nvs\n" + getSetName(test_sets[0], 0, options.columns) + "\n(x-factor)", align = "center", cssclass = "col_rel")
|
reference = getSetName(test_sets[0], 0, options.columns) if not options.progress_mode else 'previous'
|
||||||
|
tbl.newColumn(str(i) + "%", getSetName(set, i, options.columns) + "\nvs\n" + reference + "\n(x-factor)", align = "center", cssclass = "col_rel")
|
||||||
i += 1
|
i += 1
|
||||||
if options.calc_score:
|
if options.calc_score:
|
||||||
i = 1
|
i = 1
|
||||||
for set in metric_sets:
|
for set in metric_sets:
|
||||||
tbl.newColumn(str(i) + "S", getSetName(set, i, options.columns) + "\nvs\n" + getSetName(test_sets[0], 0, options.columns) + "\n(score)", align = "center", cssclass = "col_name")
|
reference = getSetName(test_sets[0], 0, options.columns) if not options.progress_mode else 'previous'
|
||||||
|
tbl.newColumn(str(i) + "S", getSetName(set, i, options.columns) + "\nvs\n" + reference + "\n(score)", align = "center", cssclass = "col_name")
|
||||||
i += 1
|
i += 1
|
||||||
|
|
||||||
# rows
|
# rows
|
||||||
@ -181,18 +183,16 @@ if __name__ == "__main__":
|
|||||||
tbl.newCell(str(i) + "S", "-", color = "red")
|
tbl.newCell(str(i) + "S", "-", color = "red")
|
||||||
else:
|
else:
|
||||||
val = getter(case, cases[0], options.units)
|
val = getter(case, cases[0], options.units)
|
||||||
if options.calc_relatives and i > 0 and val:
|
def getter_fn(fn):
|
||||||
valp = getter_p(case, cases[0], options.units)
|
if fn and i > 0 and val:
|
||||||
else:
|
for j in reversed(range(i)) if options.progress_mode else [0]:
|
||||||
valp = None
|
r = cases[j]
|
||||||
if options.calc_cr and i > 0 and val:
|
if r is not None and r.get("status") == 'run':
|
||||||
valcr = getter_cr(case, cases[0], options.units)
|
return fn(case, r, options.units)
|
||||||
else:
|
return None
|
||||||
valcr = None
|
valp = getter_fn(getter_p) if options.calc_relatives or options.progress_mode else None
|
||||||
if options.calc_score and i > 0 and val:
|
valcr = getter_fn(getter_cr) if options.calc_cr else None
|
||||||
val_score = getter_score(case, cases[0], options.units)
|
val_score = getter_fn(getter_score) if options.calc_score else None
|
||||||
else:
|
|
||||||
val_score = None
|
|
||||||
if not valp or i == 0:
|
if not valp or i == 0:
|
||||||
color = None
|
color = None
|
||||||
elif valp > 1.05:
|
elif valp > 1.05:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user