aboutsummaryrefslogtreecommitdiff
path: root/src/html/benchmark_report.html.tt
blob: 5b0679e8e22cc0e97749e26b6b3b48a226025cd3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>{title} - Criterion.rs</title>
    <style type="text/css">
        body \{
            font: 14px Helvetica Neue;
            text-rendering: optimizelegibility;
        }

        .body \{
            width: 960px;
            margin: auto;
        }

        th \{
            font-weight: 200
        }

        th,
        td \{
            padding-right: 3px;
            padding-bottom: 3px;
        }

        a:link \{
            color: #1F78B4;
            text-decoration: none;
        }

        th.ci-bound \{
            opacity: 0.6
        }

        td.ci-bound \{
            opacity: 0.5
        }

        .stats \{
            width: 80%;
            margin: auto;
            display: flex;
        }

        .additional_stats \{
            flex: 0 0 60%
        }

        .additional_plots \{
            flex: 1
        }

        h2 \{
            font-size: 36px;
            font-weight: 300;
        }

        h3 \{
            font-size: 24px;
            font-weight: 300;
        }

        #footer \{
            height: 40px;
            background: #888;
            color: white;
            font-size: larger;
            font-weight: 300;
        }

        #footer a \{
            color: white;
            text-decoration: underline;
        }

        #footer p \{
            text-align: center
        }
    </style>
</head>

<body>
    <div class="body">
        <h2>{title}</h2>
        <div class="absolute">
            <section class="plots">
                <table width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <a href="pdf.svg">
                                    <img src="pdf_small.svg" alt="PDF of Slope" width="{thumbnail_width}" height="{thumbnail_height}" />
                                </a>
                            </td>
                            <td>
                                {{- if slope }}
                                <a href="regression.svg">
                                    <img src="regression_small.svg" alt="Regression" width="{thumbnail_width}" height="{thumbnail_height}" />
                                </a>
                                {{- else }}
                                <a href="iteration_times.svg">
                                    <img src="iteration_times_small.svg" alt="Iteration Times" width="{thumbnail_width}" height="{thumbnail_height}" />
                                </a>
                                {{- endif }}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </section>
            <section class="stats">
                <div class="additional_stats">
                    <h4>Additional Statistics:</h4>
                    <table>
                        <thead>
                            <tr>
                                <th></th>
                                <th title="{confidence} confidence level" class="ci-bound">Lower bound</th>
                                <th>Estimate</th>
                                <th title="{confidence} confidence level" class="ci-bound">Upper bound</th>
                            </tr>
                        </thead>
                        <tbody>
                            {{- if slope }}
                            <tr>
                                <td>Slope</td>
                                <td class="ci-bound">{slope.lower}</td>
                                <td>{slope.point}</td>
                                <td class="ci-bound">{slope.upper}</td>
                            </tr>
                            {{- endif }}
                            {{- if throughput }}
                            <tr>
                                <td>Throughput</td>
                                <td class="ci-bound">{throughput.lower}</td>
                                <td>{throughput.point}</td>
                                <td class="ci-bound">{throughput.upper}</td>
                            </tr>
                            {{- endif }}
                            <tr>
                                <td>R&#xb2;</td>
                                <td class="ci-bound">{r2.lower}</td>
                                <td>{r2.point}</td>
                                <td class="ci-bound">{r2.upper}</td>
                            </tr>
                            <tr>
                                <td>Mean</td>
                                <td class="ci-bound">{mean.lower}</td>
                                <td>{mean.point}</td>
                                <td class="ci-bound">{mean.upper}</td>
                            </tr>
                            <tr>
                                <td title="Standard Deviation">Std. Dev.</td>
                                <td class="ci-bound">{std_dev.lower}</td>
                                <td>{std_dev.point}</td>
                                <td class="ci-bound">{std_dev.upper}</td>
                            </tr>
                            <tr>
                                <td>Median</td>
                                <td class="ci-bound">{median.lower}</td>
                                <td>{median.point}</td>
                                <td class="ci-bound">{median.upper}</td>
                            </tr>
                            <tr>
                                <td title="Median Absolute Deviation">MAD</td>
                                <td class="ci-bound">{mad.lower}</td>
                                <td>{mad.point}</td>
                                <td class="ci-bound">{mad.upper}</td>
                            </tr>
                        </tbody>
                    </table>
                </div>
                {{- if additional_plots }}
                <div class="additional_plots">
                    <h4>Additional Plots:</h4>
                    <ul>
                        {{for plot in additional_plots }}
                        <li>
                            <a href="{plot.url}">{plot.name}</a>
                        </li>
                        {{- endfor }}
                    </ul>
                </div>
                {{- endif }}
            </section>
            <section class="explanation">
                <h4>Understanding this report:</h4>
                <p>The plot on the left displays the average time per iteration for this benchmark. The shaded region
                    shows the estimated probabilty of an iteration taking a certain amount of time, while the line
                    shows the mean. Click on the plot for a larger view showing the outliers.</p>
                {{- if slope }}
                <p>The plot on the right shows the linear regression calculated from the measurements. Each point
                    represents a sample, though here it shows the total time for the sample rather than time per
                    iteration. The line is the line of best fit for these measurements.</p>
                {{- else }}
                <p>The plot on the right shows the average time per iteration for the samples. Each point 
                    represents one sample.</p>
                {{- endif }}
                <p>See <a href="https://bheisler.github.io/criterion.rs/book/user_guide/command_line_output.html#additional-statistics">the
                        documentation</a> for more details on the additional statistics.</p>
            </section>
        </div>
        {{- if comparison }}
        <section class="plots">
            <h3>Change Since Previous Benchmark</h3>
            <div class="relative">
                <table width="100%">
                    <tbody>
                        <tr>
                            <td>
                                <a href="both/pdf.svg">
                                    <img src="relative_pdf_small.svg" alt="PDF Comparison" width="{thumbnail_width}"
                                        height="{thumbnail_height}" />
                                </a>
                            </td>
                            <td>
                                {{- if slope }}
                                <a href="both/regression.svg">
                                    <img src="relative_regression_small.svg" alt="Regression Comparison" width="{thumbnail_width}"
                                        height="{thumbnail_height}" />
                                </a>
                                {{- else }}
                                <a href="both/iteration_times.svg">
                                    <img src="relative_iteration_times_small.svg" alt="Iteration Time Comparison" width="{thumbnail_width}"
                                        height="{thumbnail_height}" />
                                </a>
                                {{- endif }}
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </section>
        <section class="stats">
            <div class="additional_stats">
                <h4>Additional Statistics:</h4>
                <table>
                    <thead>
                        <tr>
                            <th></th>
                            <th title="{confidence} confidence level" class="ci-bound">Lower bound</th>
                            <th>Estimate</th>
                            <th title="{confidence} confidence level" class="ci-bound">Upper bound</th>
                            <th></th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>Change in time</td>
                            <td class="ci-bound">{comparison.change.lower}</td>
                            <td>{comparison.change.point}</td>
                            <td class="ci-bound">{comparison.change.upper}</td>
                            <td>(p = {comparison.p_value} {comparison.inequality}
                                {comparison.significance_level})</td>
                        </tr>
                        {{- if comparison.thrpt_change }}
                        <tr>
                            <td>Change in throughput</td>
                            <td class="ci-bound">{comparison.thrpt_change.lower}</td>
                            <td>{comparison.thrpt_change.point}</td>
                            <td class="ci-bound">{comparison.thrpt_change.upper}</td>
                            <td></td>
                        </tr>
                        {{- endif }}
                    </tbody>
                </table>
                {comparison.explanation}
            </div>
            {{- if comparison.additional_plots }}
            <div class="additional_plots">
                <h4>Additional Plots:</h4>
                <ul>
                    {{ for plot in comparison.additional_plots }}
                    <li>
                        <a href="{plot.url}">{plot.name}</a>
                    </li>
                    {{- endfor }}
                </ul>
            </div>
            {{- endif }}
        </section>
        <section class="explanation">
            <h4>Understanding this report:</h4>
            <p>The plot on the left shows the probability of the function taking a certain amount of time. The red
                curve represents the saved measurements from the last time this benchmark was run, while the blue curve
                shows the measurements from this run. The lines represent the mean time per iteration. Click on the
                plot for a larger view.</p>
            {{- if slope }}
            <p>The plot on the right shows the two regressions. Again, the red line represents the previous measurement
                while the blue line shows the current measurement.</p>
            {{- else }}
            <p>The plot on the right shows the iteration times for the two measurements. Again, the red dots represent
                the previous measurement while the blue dots show the current measurement.</p>
            {{- endif}}
            <p>See <a href="https://bheisler.github.io/criterion.rs/book/user_guide/command_line_output.html#change">the
                    documentation</a> for more details on the additional statistics.</p>
        </section>
        {{- endif }}
    </div>
    <div id="footer">
        <p>This report was generated by
            <a href="https://github.com/bheisler/criterion.rs">Criterion.rs</a>, a statistics-driven benchmarking
            library in Rust.</p>
    </div>
</body>

</html>