Skip to content

Commit 038aad6

Browse files
Add zero folders found check, thus no benchmarks to be displayed
1 parent 6be1576 commit 038aad6

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

Diff for: _layouts/benchmarks.html

+9-8
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<img class="logo" src="{{site.baseurl}}/assets/img/rust-python-logo.svg" alt="RustPython Logo">
1010
</div>
1111
<div class="pl-md-2">
12-
<div class="section-title">Benchmarks</div>
13-
<div class="title">{{ site.title }} {{ page.title | escape }}</div>
12+
<div class="section-title">RustPython</div>
13+
<div class="title">{{ page.title | escape }}</div>
1414
<small>{{ site.benchmarks-intro }}</small>
1515
</div>
1616
</div>
@@ -22,8 +22,6 @@
2222
{{ content }}
2323
</div>
2424

25-
<!-- TODO clean up this code a bit -->
26-
2725
{% assign folders = "" | split: ", " %}
2826
{% for image in site.static_files %}
2927
{% if image.path contains 'criterion/' %}
@@ -48,9 +46,11 @@
4846
{% endfor%}
4947
{% assign folders = folders | uniq %} -->
5048

51-
<!-- TODO check if the folders list is empty, if so, display corresponding message -->
52-
<!-- TODO add text that explains the violin plots -->
53-
49+
{% if folders.size == 0 %}
50+
<p style="color: red;">There are no benchmarks to be displayed.</p>
51+
<p>This shouldn't be happening, please contact one of the maintainers
52+
through <a href="https://gitter.im/rustpython/Lobby">Gitter</a> to report this problem.</p>
53+
{% else %}
5454
<ul class="tab" data-tab="benchmarks">
5555
{% for folder in folders %}
5656
<li {% if forloop.index==1 %} class="active" {% endif %}>
@@ -65,12 +65,13 @@
6565
{% for image in site.static_files %}
6666
{% if image.path contains folder %}
6767
<figure>
68-
<img src="{{ site.baseurl }}{{ image.path }}" alt="image" width="50%" />
68+
<img src="{{ site.baseurl }}{{ image.path }}" alt="image" />
6969
<figcaption>{{ image.name }}</figcaption>
7070
</figure>
7171
{% endif %}
7272
{% endfor%}
7373
</li>
7474
{% endfor%}
7575
</ul>
76+
{% endif %}
7677
</div>

Diff for: benchmarks.markdown

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@ layout: benchmarks
33
title: Benchmarks
44
---
55

6-
RustPython is an awesome Python interpreter! On this page you can see how it compares to CPython.
6+
This page displays some benchmarks that determine the performance of RustPython.
7+
8+
Most of these benchmarks compare RustPython to CPython.
9+
10+
More information about the benchmarks can be found on [the RustPython GitHub repo](https://github.com/RustPython/RustPython/tree/master/benches).

0 commit comments

Comments
 (0)