@@ -96,7 +96,18 @@ function drawCurrentDate(opts: GraphRenderOpts, date: Date) {
96
96
};
97
97
}
98
98
99
- async function renderGraph() {
99
+ // Render both relative and absolute graphs
100
+ async function renderGraphs() {
101
+ // We want to be able to see noise "blips" vs. a previous artifact.
102
+ // The "percent relative from previous commit" graph should be the best to
103
+ // see these kinds of changes.
104
+ renderGraph (" percentrelative" as GraphKind , relativeChartElement );
105
+ // We also want to see whether a change maintained its value or whether it was noise and has since
106
+ // returned to steady state. Here, an absolute graph ("raw") is best.
107
+ renderGraph (" raw" as GraphKind , absoluteChartElement );
108
+ }
109
+
110
+ async function renderGraph(kind : GraphKind , chartRef : Ref <HTMLElement | null >) {
100
111
const {start, end, date} = graphRange .value ;
101
112
const selector = {
102
113
benchmark: props .testCase .benchmark ,
@@ -105,20 +116,17 @@ async function renderGraph() {
105
116
stat: props .metric ,
106
117
start ,
107
118
end ,
108
- // We want to be able to see noise "blips" vs. a previous artifact.
109
- // The "percent relative from previous commit" graph should be the best to
110
- // see these kinds of changes.
111
- kind: " percentrelative" as GraphKind ,
119
+ kind ,
112
120
};
113
121
const graphData = await GRAPH_RESOLVER .loadGraph (selector );
114
122
const opts: GraphRenderOpts = {
115
- width: Math .min (window .innerWidth - 40 , 480 ),
123
+ width: Math .min (window .innerWidth - 40 , 465 ),
116
124
renderTitle: false ,
117
125
};
118
126
if (date !== null ) {
119
127
drawCurrentDate (opts , date );
120
128
}
121
- renderPlots (graphData , selector , chartElement .value , opts );
129
+ renderPlots (graphData , selector , chartRef .value , opts );
122
130
}
123
131
124
132
function getGraphTitle() {
@@ -177,7 +185,8 @@ const cargoProfile = computed((): CargoProfileMetadata => {
177
185
}
178
186
});
179
187
180
- const chartElement: Ref <HTMLElement | null > = ref (null );
188
+ const relativeChartElement: Ref <HTMLElement | null > = ref (null );
189
+ const absoluteChartElement: Ref <HTMLElement | null > = ref (null );
181
190
const graphRange = computed (() => getGraphRange (props .artifact ));
182
191
183
192
enum ProfileCommand {
@@ -205,95 +214,108 @@ function changeProfileCommand(event: Event) {
205
214
profileCommand .value = target .value as ProfileCommand ;
206
215
}
207
216
208
- onMounted (() => renderGraph ());
217
+ onMounted (() => renderGraphs ());
209
218
</script >
210
219
211
220
<template >
212
221
<div >
213
222
<div class =" columns" >
214
223
<div class =" rows grow" >
215
- <div >
216
- <div class =" title info bold" >Benchmark info</div >
217
- <table >
218
- <tbody >
219
- <tr >
220
- <td >Benchmark</td >
221
- <td >{{ testCase.benchmark }}</td >
222
- </tr >
223
- <tr >
224
- <td >Profile</td >
225
- <td >{{ testCase.profile }}</td >
226
- </tr >
227
- <tr >
228
- <td >Scenario</td >
229
- <td >{{ testCase.scenario }}</td >
230
- </tr >
231
- <tr >
232
- <td >Category</td >
233
- <td >{{ testCase.category }}</td >
234
- </tr >
235
- <tr v-if =" (metadata?.binary ?? null) !== null" >
236
- <td >Artifact</td >
237
- <td >{{ metadata.binary ? "binary" : "library" }}</td >
238
- </tr >
239
- <tr v-if =" (metadata?.iterations ?? null) !== null" >
240
- <td >
241
- Iterations
242
- <Tooltip > How many times is the benchmark executed? </Tooltip >
243
- </td >
244
- <td >{{ metadata.iterations }}</td >
245
- </tr >
246
- <tr v-if =" (cargoProfile?.lto ?? null) !== null" >
247
- <td >LTO</td >
248
- <td >{{ cargoProfile.lto }}</td >
249
- </tr >
250
- <tr v-if =" (cargoProfile?.debug ?? null) !== null" >
251
- <td >Debuginfo</td >
252
- <td >{{ cargoProfile.debug }}</td >
253
- </tr >
254
- <tr v-if =" (cargoProfile?.codegen_units ?? null) !== null" >
255
- <td >Codegen units</td >
256
- <td >{{ cargoProfile.codegen_units }}</td >
257
- </tr >
258
- </tbody >
259
- </table >
260
- </div >
261
- <div class =" links" >
262
- <div class =" title bold" >Links</div >
263
- <ul >
264
- <li >
265
- <a
266
- :href =" detailedQueryLink(props.artifact, props.baseArtifact)"
267
- target =" _blank"
268
- >
269
- Detailed results
270
- </a >
271
- </li >
272
- <li >
273
- <a
274
- :href =" graphLink(props.artifact, props.metric, props.testCase)"
275
- target =" _blank"
276
- >
277
- History graph
278
- </a >
279
- </li >
280
- <li >
281
- <a :href =" detailedQueryLink(props.baseArtifact)" target =" _blank" >
282
- Rustc self-profile: baseline commit
283
- </a >
284
- </li >
285
- <li >
286
- <a :href =" detailedQueryLink(props.artifact)" target =" _blank" >
287
- Rustc self-profile: benchmarked commit
288
- </a >
289
- </li >
290
- <li >
291
- <a :href =" benchmarkLink(testCase.benchmark)" target =" _blank" >
292
- Benchmark source code
293
- </a >
294
- </li >
295
- </ul >
224
+ <div class =" title bold" >Benchmark info</div >
225
+ <table >
226
+ <tbody >
227
+ <tr >
228
+ <td >Benchmark</td >
229
+ <td >{{ testCase.benchmark }}</td >
230
+ </tr >
231
+ <tr >
232
+ <td >Profile</td >
233
+ <td >{{ testCase.profile }}</td >
234
+ </tr >
235
+ <tr >
236
+ <td >Scenario</td >
237
+ <td >{{ testCase.scenario }}</td >
238
+ </tr >
239
+ <tr >
240
+ <td >Category</td >
241
+ <td >{{ testCase.category }}</td >
242
+ </tr >
243
+ <tr v-if =" (metadata?.binary ?? null) !== null" >
244
+ <td >Artifact</td >
245
+ <td >{{ metadata.binary ? "binary" : "library" }}</td >
246
+ </tr >
247
+ <tr v-if =" (metadata?.iterations ?? null) !== null" >
248
+ <td >
249
+ Iterations
250
+ <Tooltip > How many times is the benchmark executed? </Tooltip >
251
+ </td >
252
+ <td >{{ metadata.iterations }}</td >
253
+ </tr >
254
+ <tr v-if =" (cargoProfile?.lto ?? null) !== null" >
255
+ <td >LTO</td >
256
+ <td >{{ cargoProfile.lto }}</td >
257
+ </tr >
258
+ <tr v-if =" (cargoProfile?.debug ?? null) !== null" >
259
+ <td >Debuginfo</td >
260
+ <td >{{ cargoProfile.debug }}</td >
261
+ </tr >
262
+ <tr v-if =" (cargoProfile?.codegen_units ?? null) !== null" >
263
+ <td >Codegen units</td >
264
+ <td >{{ cargoProfile.codegen_units }}</td >
265
+ </tr >
266
+ </tbody >
267
+ </table >
268
+ </div >
269
+ <div class =" rows grow links" >
270
+ <div class =" title bold" >Links</div >
271
+ <ul >
272
+ <li >
273
+ <a
274
+ :href =" detailedQueryLink(props.artifact, props.baseArtifact)"
275
+ target =" _blank"
276
+ >
277
+ Detailed results
278
+ </a >
279
+ </li >
280
+ <li >
281
+ <a
282
+ :href =" graphLink(props.artifact, props.metric, props.testCase)"
283
+ target =" _blank"
284
+ >
285
+ History graph
286
+ </a >
287
+ </li >
288
+ <li >
289
+ <a :href =" detailedQueryLink(props.baseArtifact)" target =" _blank" >
290
+ Rustc self-profile: baseline commit
291
+ </a >
292
+ </li >
293
+ <li >
294
+ <a :href =" detailedQueryLink(props.artifact)" target =" _blank" >
295
+ Rustc self-profile: benchmarked commit
296
+ </a >
297
+ </li >
298
+ <li >
299
+ <a :href =" benchmarkLink(testCase.benchmark)" target =" _blank" >
300
+ Benchmark source code
301
+ </a >
302
+ </li >
303
+ </ul >
304
+ </div >
305
+ </div >
306
+ <div class =" columns graphs" >
307
+ <div class =" rows center-items grow" >
308
+ <div class =" title" >
309
+ <div class =" bold" >{{ getGraphTitle() }}</div >
310
+ <div style =" font-size : 0.8em " >
311
+ Plot of the absolute values of the current metric
312
+ </div >
313
+ <div style =" font-size : 0.8em " >
314
+ The shaded region shows values that are more recent than the
315
+ benchmarked commit
316
+ </div >
296
317
</div >
318
+ <div ref =" absoluteChartElement" ></div >
297
319
</div >
298
320
<div class =" rows center-items grow" >
299
321
<div class =" title" >
@@ -306,7 +328,7 @@ onMounted(() => renderGraph());
306
328
benchmarked commit
307
329
</div >
308
330
</div >
309
- <div ref =" chartElement " ></div >
331
+ <div ref =" relativeChartElement " ></div >
310
332
</div >
311
333
</div >
312
334
<div class =" command" >
@@ -358,17 +380,25 @@ onMounted(() => renderGraph());
358
380
.grow {
359
381
flex-grow : 1 ;
360
382
}
383
+
384
+ & .graphs {
385
+ flex-wrap : nowrap ;
386
+ }
387
+ }
388
+ .graphs {
389
+ margin-top : 15px ;
361
390
}
362
391
.rows {
363
392
display : flex ;
364
393
flex-direction : column ;
365
- gap : 15 px ;
394
+ gap : 10 px ;
366
395
367
396
& .center-items {
368
397
align-items : center ;
369
398
}
370
399
}
371
400
.command {
401
+ margin-top : 15px ;
372
402
text-align : left ;
373
403
}
374
404
0 commit comments