1
1
<script setup lang="ts">
2
- import {TestCaseComparison } from " ../data" ;
3
- import Tooltip from " ../tooltip.vue" ;
4
- import {ArtifactDescription } from " ../types" ;
5
- import {percentClass } from " ../shared" ;
6
- import {CompileBenchmarkMap , CompileTestCase } from " ./common" ;
2
+ import {TestCaseComparison } from " ../../ data" ;
3
+ import Tooltip from " ../../ tooltip.vue" ;
4
+ import {ArtifactDescription } from " ../../ types" ;
5
+ import {percentClass } from " ../../ shared" ;
6
+ import {CompileBenchmarkMap , CompileTestCase } from " .. /common" ;
7
7
import {computed } from " vue" ;
8
+ import {useExpandedStore } from " ./expansion" ;
9
+ import BenchmarkDetail from " ./benchmark-detail.vue" ;
8
10
9
11
const props = defineProps <{
10
12
id: string ;
@@ -60,40 +62,13 @@ function prettifyRawNumber(number: number): string {
60
62
return number .toLocaleString ();
61
63
}
62
64
63
- function generateBenchmarkTooltip( testCase : CompileTestCase ) : string {
64
- const metadata = props . benchmarkMap [ testCase . benchmark ] ?? null ;
65
- if (metadata === null ) {
66
- return " <No metadata found> " ;
65
+ const columnCount = computed (() => {
66
+ const base = 7 ;
67
+ if (props . showRawData ) {
68
+ return base + 2 ;
67
69
}
68
- let tooltip = ` Benchmark: ${testCase .benchmark }
69
- Category: ${metadata .category }
70
- ` ;
71
- if (metadata .binary !== null ) {
72
- tooltip += ` Artifact: ${metadata .binary ? " binary" : " library" }\n ` ;
73
- }
74
- if (metadata .iterations !== null ) {
75
- tooltip += ` Iterations: ${metadata .iterations }\n ` ;
76
- }
77
- const addMetadata = ({lto , debug , codegen_units }) => {
78
- if (lto !== null ) {
79
- tooltip += ` LTO: ${lto }\n ` ;
80
- }
81
- if (debug !== null ) {
82
- tooltip += ` Debuginfo: ${debug }\n ` ;
83
- }
84
- if (codegen_units !== null ) {
85
- tooltip += ` Codegen units: ${codegen_units }\n ` ;
86
- }
87
- };
88
- if (testCase .profile === " opt" && metadata .release_profile !== null ) {
89
- addMetadata (metadata .release_profile );
90
- } else if (testCase .profile === " debug" && metadata .dev_profile !== null ) {
91
- addMetadata (metadata .dev_profile );
92
- }
93
-
94
- return tooltip ;
95
- }
96
-
70
+ return base ;
71
+ });
97
72
const unit = computed (() => {
98
73
// The DB stored wall-time data in seconds for compile benchmarks, so it is
99
74
// hardcoded here
@@ -103,6 +78,7 @@ const unit = computed(() => {
103
78
return null ;
104
79
}
105
80
});
81
+ const {toggleExpanded, isExpanded} = useExpandedStore ();
106
82
</script >
107
83
108
84
<template >
@@ -114,11 +90,12 @@ const unit = computed(() => {
114
90
<table v-else class =" benches compare" >
115
91
<thead >
116
92
<tr >
93
+ <th class =" toggle" ></th >
117
94
<th >Benchmark</th >
118
95
<th >Profile</th >
119
96
<th >Scenario</th >
120
97
<th >% Change</th >
121
- <th >
98
+ <th class = " narrow " >
122
99
Significance Threshold
123
100
<Tooltip >
124
101
The minimum % change that is considered significant. The higher
@@ -132,7 +109,7 @@ const unit = computed(() => {
132
109
how the significance threshold is calculated.
133
110
</Tooltip >
134
111
</th >
135
- <th >
112
+ <th class = " narrow " >
136
113
Significance Factor
137
114
<Tooltip >
138
115
How much a particular result is over the significance threshold. A
@@ -147,7 +124,10 @@ const unit = computed(() => {
147
124
<tbody >
148
125
<template v-for =" comparison in comparisons " >
149
126
<tr >
150
- <td :title =" generateBenchmarkTooltip(comparison.testCase)" >
127
+ <td @click =" toggleExpanded(comparison.testCase)" class =" toggle" >
128
+ {{ isExpanded(comparison.testCase) ? "▼" : "▶" }}
129
+ </td >
130
+ <td >
151
131
<a
152
132
v-bind:href =" benchmarkLink(comparison.testCase.benchmark)"
153
133
class =" silent-link"
@@ -181,7 +161,7 @@ const unit = computed(() => {
181
161
</div >
182
162
</div >
183
163
</td >
184
- <td >
164
+ <td class = " narrow " >
185
165
<div class =" numeric-aligned" >
186
166
<div >
187
167
{{
@@ -192,7 +172,7 @@ const unit = computed(() => {
192
172
</div >
193
173
</div >
194
174
</td >
195
- <td >
175
+ <td class = " narrow " >
196
176
<div class =" numeric-aligned" >
197
177
<div >
198
178
{{
@@ -218,6 +198,14 @@ const unit = computed(() => {
218
198
</a >
219
199
</td >
220
200
</tr >
201
+ <tr v-if =" isExpanded(comparison.testCase)" >
202
+ <td :colspan =" columnCount" >
203
+ <BenchmarkDetail
204
+ :test-case =" comparison.testCase"
205
+ :benchmark-map =" benchmarkMap"
206
+ />
207
+ </td >
208
+ </tr >
221
209
</template >
222
210
</tbody >
223
211
</table >
@@ -226,8 +214,9 @@ const unit = computed(() => {
226
214
227
215
<style scoped lang="scss">
228
216
.benches {
217
+ width : 100% ;
218
+ table-layout : auto ;
229
219
font-size : medium ;
230
- table-layout : fixed ;
231
220
232
221
td ,
233
222
th {
@@ -249,15 +238,22 @@ const unit = computed(() => {
249
238
border-right : dotted 1px ;
250
239
}
251
240
252
- .benches th {
253
- text-align : center ;
254
- min-width : 50px ;
241
+ .benches {
242
+ td ,
243
+ th {
244
+ text-align : center ;
245
+
246
+ & .toggle {
247
+ padding-right : 5px ;
248
+ cursor : pointer ;
249
+ }
250
+ & .narrow {
251
+ max-width : 100px ;
252
+ }
253
+ }
255
254
}
256
255
257
256
.benches td {
258
- text-align : center ;
259
- width : 25% ;
260
-
261
257
& > .numeric-aligned {
262
258
display : flex ;
263
259
flex-direction : column ;
0 commit comments