Commit 06922a71 authored by Zixian Cai's avatar Zixian Cai

Ratio is now compared with baseline (first commit)

parent 571c48a6
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
{% else %} {% else %}
var trace = {type: "scatter", visible: 'legendonly'}; var trace = {type: "scatter", visible: 'legendonly'};
{% endif %} {% endif %}
var None = null; // emulate Python None
var n = {{ timeline[keyname]|length }}; var n = {{ timeline[keyname]|length }};
var x = {{ timeline_revisions|safe }}; var x = {{ timeline_revisions|safe }};
var y = {{ timeline[keyname] }}; var y = {{ timeline[keyname] }};
......
...@@ -38,16 +38,17 @@ def make_timeline(ops): ...@@ -38,16 +38,17 @@ def make_timeline(ops):
for metric in x[ts][impl]: for metric in x[ts][impl]:
keyname = "{}/{}/{}".format(ts, impl, metric) keyname = "{}/{}/{}".format(ts, impl, metric)
results[keyname][idx] = x[ts][impl][metric].mean results[keyname][idx] = x[ts][impl][metric].mean
baseline = {}
for k in results: for k in results:
v = results[k] v = results[k]
collect_dict = [None] * len(extracts) collect_dict = [None] * len(extracts)
for k1, v1 in v.items(): for k1, v1 in v.items():
collect_dict[k1] = v1 collect_dict[k1] = v1
ratio = [1] * len(extracts) ratio = [None] * len(extracts)
for i in range(1, len(extracts)): for i in range(0, len(extracts)):
if collect_dict[i - 1] is not None: if collect_dict[i]:
ratio[i] = collect_dict[i] / collect_dict[i - 1] if k not in baseline:
else: baseline[k] = collect_dict[i]
ratio[i - 1] = 1 ratio[i] = collect_dict[i] / baseline[k]
results[k] = ratio results[k] = ratio
return results, revisions return results, revisions
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment