Skip to content

Commit 224babe

Browse files
committed
Use the proper key for CPython data
Update default baseline Increase width of second graph
1 parent eaea00d commit 224babe

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

codespeed/views.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,7 @@ def get_home_data(request):
935935
cp_exe = Executable.objects.get(name="cpython")
936936
cp_lastrev = Revision.objects.filter(
937937
branch__project=cp_exe.project).order_by('-date')[0]
938+
data['baseline'] = 'CPython ' + cp_lastrev.tag
938939
cp_results = Result.objects.filter(
939940
executable=cp_exe, revision=cp_lastrev, environment=env)
940941

@@ -969,8 +970,7 @@ def get_home_data(request):
969970
if res == 0:
970971
continue
971972
benchmarks.append(res.benchmark.name)
972-
key = 'CPython ' + cp_lastrev.tag
973-
data['results'][res.benchmark.name] = {key: res.value}
973+
data['results'][res.benchmark.name] = {data['baseline']: res.value}
974974
for rev_name in pp_results:
975975
val = 0
976976
for pp_res in pp_results[rev_name]:

example/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def process_exception(self, request, exception):
124124
#DEF_ENVIRONMENT = None #Name of the environment which should be selected as default
125125

126126

127-
DEF_BASELINE = {'executable': 'cpython', 'revision': '100'} # Which executable + revision should be default as a baseline
127+
DEF_BASELINE = {'executable': 'cpython', 'revision': '101'} # Which executable + revision should be default as a baseline
128128
# Given as the name of the executable and commitid of the revision
129129
# Example: defaultbaseline = {'executable': 'myexe', 'revision': '21'}
130130

example/templates/home.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@
3838
add_to_tagged_data = false;
3939
}
4040
if (add_to_tagged_data === false) { break; }
41-
relative_value = data['results'][benchname][rev]/data['results'][benchname]['CPython 2.6.2'];
41+
relative_value = data['results'][benchname][rev]/data['results'][benchname][data['baseline']];
4242
tagged_data[i].push(relative_value)
4343
}
4444
// Only add benchmark if there are no 0 values
4545
if (add_to_tagged_data === false) { continue; }
4646
// First add benchmark
4747
benchmarks.push(benchname);
4848
// Add PyPy trunk and CPython's 1.0 value
49-
relative_value = data['results'][benchname]['PyPy trunk']/data['results'][benchname]['CPython 2.6.2'];
49+
relative_value = data['results'][benchname]['PyPy trunk']/data['results'][benchname][data['baseline']];
5050
plotdata[0].push(relative_value);
5151
plotdata[1].push(1.0);
5252
labels.push(relative_value.toFixed(2));
@@ -73,7 +73,7 @@
7373
pointLabels:{labels:labels}
7474
},
7575
{
76-
label: 'CPython',
76+
label: data['baseline'],
7777
pointLabels:{show:false}
7878
}
7979
],
@@ -84,7 +84,7 @@
8484
tickOptions: {angle: -40}
8585
},
8686
yaxis:{
87-
ticks: [0, 0.25, 0.5, 0.75, 1, 1.25, 1.5],
87+
ticks: [0, 0.25, 0.5, 0.75, 1, 1.25],
8888
tickOptions:{formatString:'%.2f'}
8989
}
9090
}
@@ -104,7 +104,7 @@
104104
geomeans.push(tempgeo);
105105
}
106106
geomeans.push(trunk_geomean);
107-
var ticks = ['CPython 2.6.2'];
107+
var ticks = [data['baseline']];
108108
for (var i in data['tagged_revs']) {
109109
ticks.push(data['tagged_revs'][i]);
110110
}
@@ -195,7 +195,7 @@ <h3>How fast is PyPy?</h3>
195195
<p>It depends greatly on the type of task being performed. The geometric average of all benchmarks is <span id="geomean"></span> or <strong id="geofaster"></strong> times <em>faster</em> than CPython</p>
196196
<h3>How has PyPy performance evolved over time?</h3>
197197

198-
<div id="cpythonplot2" style="width:500px;height:400px;margin: 0 auto;"></div>
198+
<div id="cpythonplot2" style="width:600px;height:400px;margin: 0 auto;"></div>
199199
<p style="font-size:smaller;">Plot 2: Geometric averages of normalized times, out of <span id="num_of_benchs"></span> benchmarks. Smaller is better. "times faster" inside parenthesis</p>
200200
</div>
201201
</div>

0 commit comments

Comments
 (0)