From 6659a1c08dda0d6ec20f945e135b23b544db55a4 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Wed, 2 Nov 2016 12:55:20 +0100 Subject: Added performance tests --- tools/parsebench.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'tools/parsebench.py') diff --git a/tools/parsebench.py b/tools/parsebench.py index 96c36d6..671e482 100755 --- a/tools/parsebench.py +++ b/tools/parsebench.py @@ -10,8 +10,8 @@ import itertools def parse_one_line(line): row = line.rstrip().split(":") - assert row[0].startswith("mergeoutput.") - iteration = int(row[0][12:]) + assert row[0].startswith("bench-") + iteration = int(row[0][6:]) stage = row[2].strip() data = ast.literal_eval(row[3].strip()) return (iteration, stage, data) @@ -30,29 +30,34 @@ def main(): print "" print "" +scale = 0.25 + def parse_one_file(filename): lines = [parse_one_line(line) for line in open(filename)] iterations = itertools.groupby(lines, lambda x: x[0]) print "

%s

" % (filename,) print "
" legend = [] + firsttime = True for (i, iteration) in iterations: - print "" + print >>sys.stderr, (i, iteration) + print "
" for (stagen, (_, stage, data)) in enumerate(iteration): - if i == 0: + if firsttime: legend.append("
%s" % (stage,)) data = list(data) for (itemn, (item, useconds)) in enumerate(data): seconds = useconds / 1000000 step = 50 / (len(data) - 1) - print "
" - if i == 0: + if firsttime: legend.append("") print "
" % (seconds/4, stagen * 90, itemn * step + 40, stage, item, seconds) - if i == 0: + print "" % (int(seconds*scale), stagen * 90, itemn * step + 40, stage, item, seconds) + if firsttime: legend.append("%s" % (stagen * 90, itemn * step + 40, item)) print " " print "
" + firsttime = False print "
" print "
" print "
" -- cgit v1.1 From 88cc9feeb5c8838aad8edc0926c82b48eaa00c6c Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Sat, 19 Nov 2016 12:54:17 +0100 Subject: Only allocate one color per stage --- tools/parsebench.py | 49 ++++++++++++++++++++++++++++++++++++------------- 1 file changed, 36 insertions(+), 13 deletions(-) (limited to 'tools/parsebench.py') diff --git a/tools/parsebench.py b/tools/parsebench.py index 671e482..067cf65 100755 --- a/tools/parsebench.py +++ b/tools/parsebench.py @@ -37,33 +37,56 @@ def parse_one_file(filename): iterations = itertools.groupby(lines, lambda x: x[0]) print "

%s

" % (filename,) print "
" - legend = [] firsttime = True + + stageorderdict = {} + stageorder = [] + stages = {} + itemorder = {} + + for (i, iteration) in iterations: + for (_, stage, data) in iteration: + if stage not in stages: + stageorderdict[stage] = len(stageorderdict) + stageorder.append(stage) + stages[stage] = {} + itemorder[stage] = [] + for (item, useconds) in data: + if item not in stages[stage]: + itemorder[stage].append(item) + stages[stage][item] = len(stages[stage]) + + iterations = itertools.groupby(lines, lambda x: x[0]) for (i, iteration) in iterations: print >>sys.stderr, (i, iteration) print "" - for (stagen, (_, stage, data)) in enumerate(iteration): - if firsttime: - legend.append("
%s" % (stage,)) + for (_, stage, data) in iteration: data = list(data) for (itemn, (item, useconds)) in enumerate(data): seconds = useconds / 1000000 - step = 50 / (len(data) - 1) - print "
" - if firsttime: - legend.append("") print "
" % (int(seconds*scale), stagen * 90, itemn * step + 40, stage, item, seconds) - if firsttime: - legend.append("%s" % (stagen * 90, itemn * step + 40, item)) + shades = stages[stage] + step = 50 / (len(shades) - 1) + shade = shades[item] + stagen = stageorderdict[stage] + print "" % (int(seconds*scale), stagen * 90, shade * step + 40, stage, item, seconds) print " " print "
" - firsttime = False print "
" print "
" print "
" print "
" - for row in legend: - print row + + for stage in stageorder: + print "
%s" % (stage,) + shades = stages[stage] + for item in itemorder[stage]: + shade = shades[item] + step = 50 / (len(shades) - 1) + + stagen = stageorderdict[stage] + print "%s" % (stagen * 90, shade * step + 40, item) + print "
" print "
" main() -- cgit v1.1 From bc65371739172f05b76a44383147063ca9056297 Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Tue, 22 Nov 2016 15:28:35 +0100 Subject: parsebench: change from table to div:s --- tools/parsebench.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tools/parsebench.py') diff --git a/tools/parsebench.py b/tools/parsebench.py index 067cf65..6897b57 100755 --- a/tools/parsebench.py +++ b/tools/parsebench.py @@ -59,7 +59,7 @@ def parse_one_file(filename): iterations = itertools.groupby(lines, lambda x: x[0]) for (i, iteration) in iterations: print >>sys.stderr, (i, iteration) - print "" + sys.stdout.write("
") for (_, stage, data) in iteration: data = list(data) for (itemn, (item, useconds)) in enumerate(data): @@ -68,10 +68,10 @@ def parse_one_file(filename): step = 50 / (len(shades) - 1) shade = shades[item] stagen = stageorderdict[stage] - print "
" - print "
" % (int(seconds*scale), stagen * 90, shade * step + 40, stage, item, seconds) + print "
" % (int(seconds*scale), stagen * 90, shade * step + 40, stage, item, seconds) print " " - print "
" + sys.stdout.write("") + sys.stdout.write("") print "" print "
" print "
" -- cgit v1.1