|
1 | 1 | <!doctype html>
|
2 | 2 | <html>
|
3 | 3 | <head>
|
| 4 | + <meta charset="utf-8"> |
4 | 5 | <link rel="stylesheet" href="uPlot.min.css">
|
| 6 | + <link rel="alternate icon" type="image/png" href="/favicon-32x32.png"> |
| 7 | + <link rel="icon" type="image/svg+xml" href="/favicon.svg"> |
| 8 | + <link rel="stylesheet" type="text/css" href="perf.css"> |
5 | 9 | <style>
|
6 | 10 | .uplot {
|
7 | 11 | display: inline-block;
|
|
38 | 42 | white-space: pre;
|
39 | 43 | font-family: monospace;
|
40 | 44 | }
|
| 45 | + body { |
| 46 | + padding: 1em; |
| 47 | + margin: 0; |
| 48 | + } |
41 | 49 | </style>
|
42 | 50 | <script src="uPlot.iife.min.js"></script>
|
| 51 | + <script src="shared.js"></script> |
| 52 | + <title>rustc performance data</title> |
43 | 53 | </head>
|
44 | 54 | <body>
|
| 55 | + <div>> <a href="index.html">graphs</a>, <a href="compare.html">compare</a>, |
| 56 | + <a href="dashboard.html">dashboard</a>, <a href="status.html">status</a>.</div> |
| 57 | + <div id="settings"> |
| 58 | + start: <input placeholder="yyyy-mm-dd or commit" id="start-bound" /> |
| 59 | + end: <input placeholder="yyyy-mm-dd or commit" id="end-bound" /> |
| 60 | + Absolute data: <input id='absolute' name="absolute" type="checkbox"> |
| 61 | + <select id='stats' name="stat"></select> |
| 62 | + <a href="#" onClick="submit_settings(); return false;">Submit</a> |
| 63 | + </div> |
| 64 | + <div> |
| 65 | + See <a href="/compare.html">compare page</a> for descriptions of what |
| 66 | + the names mean. |
| 67 | + </div> |
| 68 | + <div id="loading"><h2>Loading & rendering data..</h2><h3>This may take a while!</h3></div> |
| 69 | + <div id="charts"></div> |
| 70 | + <div id="as-of"></div> |
| 71 | + <a href="https://github.com/rust-lang-nursery/rustc-perf"> |
| 72 | + <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/38ef81f8aca64bb9a64448d0d70f1308ef5341ab/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f6461726b626c75655f3132313632312e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"> |
| 73 | + </a> |
| 74 | + |
45 | 75 | <script>
|
46 | 76 | const seriesColors = ["#7cb5ec", "#434348", "#90ed7d", "#f7a35c", "#8085e9", "#f15c80", "#e4d354", "#2b908f", "#f45b5b", "#91e8e1"];
|
47 | 77 | const interpolatedColor = "#fcb0f1";
|
|
179 | 209 | },
|
180 | 210 | ],
|
181 | 211 | plugins: [
|
| 212 | + { |
| 213 | + hooks: { |
| 214 | + drawAxes: [ |
| 215 | + u => { |
| 216 | + let { ctx } = u; |
| 217 | + let { left, top, width, height } = u.bbox; |
| 218 | + |
| 219 | + const interpolatedColorWithAlpha = "#fcb0f15f"; |
| 220 | + |
| 221 | + ctx.save(); |
| 222 | + ctx.strokeStyle = interpolatedColorWithAlpha; |
| 223 | + ctx.beginPath(); |
| 224 | + |
| 225 | + u.data[0].forEach((v, j) => { |
| 226 | + if (isInterpolated(j)) { |
| 227 | + let cx = Math.round(u.valToPos(v, 'x', true)); |
| 228 | + ctx.moveTo(cx, top); |
| 229 | + ctx.lineTo(cx, top + height); |
| 230 | + } |
| 231 | + }); |
| 232 | + |
| 233 | + ctx.closePath(); |
| 234 | + ctx.stroke(); |
| 235 | + ctx.restore(); |
| 236 | + }, |
| 237 | + ] |
| 238 | + }, |
| 239 | + }, |
182 | 240 | tooltipPlugin({
|
183 | 241 | onclick(u, seriesIdx, dataIdx) {
|
184 | 242 | let thisCommit = commits[dataIdx][1];
|
185 | 243 | let prevCommit = (commits[dataIdx-1] || [null,null])[1];
|
186 |
| - window.open(`https://perf.rust-lang.org/compare.html?start=${prevCommit}&end=${thisCommit}&stat=${stat}`); |
| 244 | + window.open(`/compare.html?start=${prevCommit}&end=${thisCommit}&stat=${stat}`); |
187 | 245 | },
|
188 | 246 | commits,
|
189 | 247 | isInterpolated,
|
|
201 | 259 | for (let benchKind in benchKinds) {
|
202 | 260 | let cacheStates = benchKinds[benchKind];
|
203 | 261 |
|
204 |
| - let yAxisLabel = i == 0 ? "Value" : null; |
| 262 | + let yAxis = "Value"; |
| 263 | + if (state.stat == "instructions:u") { |
| 264 | + yAxis = "Number of CPU instructions"; |
| 265 | + } else if (state.stat == "cycles:u") { |
| 266 | + yAxis = "Number of CPU cycles"; |
| 267 | + } else if (state.stat == "cpu-clock") { |
| 268 | + yAxis = "Wall time execution (seconds)"; |
| 269 | + } else if (state.stat == "wall-time") { |
| 270 | + yAxis = "Wall time execution (seconds)"; |
| 271 | + } else if (state.stat == "max-rss") { |
| 272 | + yAxis = "Maximum resident set size (kb)"; |
| 273 | + } else if (state.stat == "faults") { |
| 274 | + yAxis = "Faults"; |
| 275 | + } |
| 276 | + |
| 277 | + let yAxisLabel = i == 0 ? yAxis : null; |
205 | 278 |
|
206 | 279 | let seriesOpts = [{}];
|
207 | 280 |
|
|
219 | 292 | seriesOpts.push({
|
220 | 293 | label: cacheState,
|
221 | 294 | width: devicePixelRatio,
|
222 |
| - stroke: seriesColors[j], |
| 295 | + stroke: seriesColors[j] |
223 | 296 | });
|
224 | 297 |
|
225 | 298 | j++;
|
|
238 | 311 | },
|
239 | 312 | });
|
240 | 313 |
|
241 |
| - let u = new uPlot(plotOpts, plotData, document.body); |
| 314 | + let u = new uPlot(plotOpts, plotData, |
| 315 | + document.querySelector("#charts")); |
242 | 316 |
|
243 | 317 | i++;
|
244 | 318 | }
|
245 | 319 | }
|
| 320 | + document.querySelector("#loading").style.display = 'none'; |
246 | 321 | }
|
247 | 322 |
|
248 |
| - const BASE_URL = "https://perf.rust-lang.org/perf"; |
249 |
| - |
250 |
| - function post(path, body) { |
| 323 | + function post_json(path, body) { |
251 | 324 | return fetch(BASE_URL + path, {
|
252 | 325 | method: "POST",
|
253 |
| - // headers: {"Content-Type": "application/json"}, |
254 | 326 | body: JSON.stringify(body),
|
255 | 327 | }).then(r => r.json());
|
256 | 328 | }
|
|
282 | 354 | return data;
|
283 | 355 | }
|
284 | 356 |
|
285 |
| - const state = { |
286 |
| - start: "", |
287 |
| - end: "", |
288 |
| - stat: "instructions:u", |
289 |
| - absolute: true, |
290 |
| - }; |
| 357 | + function submit_settings() { |
| 358 | + let start = document.getElementById("start-bound").value; |
| 359 | + let end = document.getElementById("end-bound").value; |
| 360 | + let absolute = document.getElementById("absolute").checked; |
| 361 | + let stat = getSelected("stats"); |
| 362 | + let params = new URLSearchParams(); |
| 363 | + params.append("start", start); |
| 364 | + params.append("end", end); |
| 365 | + params.append("absolute", absolute); |
| 366 | + params.append("stat", stat); |
| 367 | + window.location.search = params.toString(); |
| 368 | + } |
291 | 369 |
|
292 |
| - post("/graph-new", state).then(prepData).then(data => renderPlots(data, state)); |
| 370 | + load_state(state => { |
| 371 | + let values = Object.assign({}, { |
| 372 | + start: "", |
| 373 | + end: "", |
| 374 | + stat: "instructions:u", |
| 375 | + absolute: true, |
| 376 | + }, state); |
| 377 | + post_json("/graph-new", values).then(prepData).then(data => |
| 378 | + renderPlots(data, values)); |
| 379 | + }); |
293 | 380 | </script>
|
294 | 381 | </body>
|
295 | 382 | </html>
|
0 commit comments