Skip to content

Commit c3cc2d2

Browse files
committed
use pypy 3.12 for the home page graphs
1 parent 0e95517 commit c3cc2d2

4 files changed

Lines changed: 17 additions & 7 deletions

File tree

‎codespeed/views.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ def embed_comparison(request):
114114

115115
@require_GET
116116
def gethistoricaldata(request):
117-
data = {'results': {}, 'benchmarks': []}
117+
# 'labels' maps each key in tagged_revs (plus baseline and 'latest') to
118+
# a two-line label [tag, project] for the x axis of the history chart.
119+
data = {'results': {}, 'benchmarks': [], 'labels': {}}
118120
env = Environment.objects.all()
119121
if settings.DEF_ENVIRONMENT:
120122
env = env.get(name=settings.DEF_ENVIRONMENT)
@@ -134,6 +136,7 @@ def gethistoricaldata(request):
134136
)
135137
rev0 = rev[0]
136138
resname = '{} {}'.format(b['executable'], rev0.tag)
139+
data['labels'][resname] = [rev0.tag, baseline_exe.project.name]
137140
baseline_results.append((resname, Result.objects.filter(
138141
executable=baseline_exe, revision=rev0, environment=env,
139142
benchmark__source='legacy')))
@@ -165,12 +168,14 @@ def gethistoricaldata(request):
165168
logger.info("no results for '%s' '%s' '%s'" % (str(_default_exe), str(rev), str(env)))
166169
continue
167170
default_results[rev.tag] = res
171+
data['labels'][rev.tag] = [rev.tag, _default_exe.project.name]
168172
data['tagged_revs'] = [rev.tag for rev in all_taggedrevs if rev.tag in default_results]
169173
# Fetch data for latest results
170174
executable = settings.DEF_EXECUTABLES[0]
171175
def_name = executable['name']
172176
def_project = Project.objects.get(name=executable['project'])
173177
default_exe = Executable.objects.get(name=def_name, project=def_project)
178+
data['labels']['latest'] = ['latest', default_exe.project.name]
174179
default_branch = Branch.objects.get(
175180
name=default_exe.project.default_branch,
176181
project=default_exe.project)

‎speed_pypy/settings.py‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
{'executable': 'cpython', 'revision': '3.11.15'},
9494
]
9595
DEF_EXECUTABLES = [
96+
{'name': 'pypy3.12-jit-64', 'project': 'PyPy3.12'},
9697
{'name': 'pypy3.11-jit-64', 'project': 'PyPy3.11'},
9798
]
9899
DEF_ENVIRONMENT = 'benchmarker2'

‎speed_pypy/templates/embed_comparison.html‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>PyPy vs CPython benchmark comparison</title>
88
<style>
9-
html, body { margin: 0; padding: 0; background: transparent; }
9+
html, body { margin: 0; padding: 0; background: transparent; height: 100%; overflow: hidden; }
10+
/* Fill the embedding iframe so the rotated benchmark labels are never
11+
clipped: the host page controls the height via the iframe. */
1012
#baseline-comparison-plot {
1113
position: relative;
1214
width: 100%;
13-
height: 480px;
15+
height: 100vh;
1416
font-family: sans-serif;
1517
}
1618
</style>

‎speed_pypy/templates/home.html‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ <h2>Comparison</h2>
3131
<h3>How fast is {{ default_exe.project }}?</h3>
3232
<iframe src="{% url 'embed-comparison' %}"
3333
title="{{ default_exe.project }} ({{ default_exe }}) vs {{ baseline }} benchmark comparison"
34-
style="border:0;width:100%;height:400px"
34+
style="border:0;width:100%;height:480px"
3535
loading="lazy"></iframe>
3636
<p class="plot-caption">Plot 1: The above plot represents {{ default_exe.project }} ({{ default_exe }}) benchmark times normalized to {{ baseline }}. Smaller is better.</p>
3737
<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 {{ baseline }}</p>
@@ -120,9 +120,11 @@ <h3>How has PyPy performance evolved over time?</h3>
120120
geomeans.push(1 / trunk_geomean);
121121
$('#num_of_benchs').html(num_of_benchs);
122122

123-
var ticks2 = [data['baseline']];
124-
for (var i in data['tagged_revs']) { ticks2.push(data['tagged_revs'][i]); }
125-
ticks2.push('latest {{ default_exe.project }}');
123+
// Two-line labels: [tag, project]; fall back to the key itself.
124+
var labelFor = function(key) { return (data['labels'] || {})[key] || key; };
125+
var ticks2 = [labelFor(data['baseline'])];
126+
for (var i in data['tagged_revs']) { ticks2.push(labelFor(data['tagged_revs'][i])); }
127+
ticks2.push(labelFor('latest'));
126128

127129
var wrap2 = document.getElementById('historical-plot');
128130
var canvas2 = document.createElement('canvas');

0 commit comments

Comments
 (0)