@@ -10,6 +10,7 @@ import {
10
10
import {SummaryGroup } from " ./data" ;
11
11
import SummaryPercentValue from " ./summary/percent-value.vue" ;
12
12
import SummaryRange from " ./summary/range.vue" ;
13
+ import TabComponent from " ../../components/tab.vue" ;
13
14
14
15
const props = withDefaults (
15
16
defineProps <{
@@ -42,27 +43,29 @@ function SummaryTable({summary}: {summary: SummaryGroup}) {
42
43
const valid = summary .all .count > 0 ;
43
44
if (valid ) {
44
45
return (
45
- <table >
46
- <thead >
47
- <tr >
48
- <th >Range</th >
49
- <th >Mean</th >
50
- </tr >
51
- </thead >
52
- <thead >
53
- <tr >
54
- <td >
55
- <SummaryRange range = { summary .all .range } />
56
- </td >
57
- <td >
58
- <SummaryPercentValue
59
- class = { percentClass (summary .all .average )}
60
- value = { summary .all .average }
61
- />
62
- </td >
63
- </tr >
64
- </thead >
65
- </table >
46
+ <div class = " table-wrapper" >
47
+ <table >
48
+ <thead >
49
+ <tr >
50
+ <th >Range</th >
51
+ <th >Mean</th >
52
+ </tr >
53
+ </thead >
54
+ <thead >
55
+ <tr >
56
+ <td >
57
+ <SummaryRange range = { summary .all .range } />
58
+ </td >
59
+ <td >
60
+ <SummaryPercentValue
61
+ class = { percentClass (summary .all .average )}
62
+ value = { summary .all .average }
63
+ />
64
+ </td >
65
+ </tr >
66
+ </thead >
67
+ </table >
68
+ </div >
66
69
);
67
70
}
68
71
return <div >No results</div >;
@@ -95,36 +98,33 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
95
98
96
99
<template >
97
100
<div class =" wrapper" >
98
- <div
99
- class = " tab "
100
- title =" Compilation time benchmarks: measure how long does it take to compile various crates using the compared rustc. "
101
- :class = " {selected: activeTab === Tab.CompileTime} "
101
+ <TabComponent
102
+ tooltip = " Compilation time benchmarks: measure how long does it take to compile various crates using the compared rustc. "
103
+ title =" Compile- time"
104
+ :selected = " activeTab === Tab.CompileTime"
102
105
@click =" changeTab(Tab.CompileTime)"
103
106
>
104
- <div class =" title" >Compile-time</div >
105
- <div class =" summary table-wrapper" >
107
+ <template v-slot :summary >
106
108
<SummaryTable :summary =" compileTimeSummary" />
107
- </div >
108
- </div >
109
- <div
110
- class = " tab "
111
- title =" Runtime benchmarks: measure how long does it take to execute (i.e. how fast are) programs compiled by the compared rustc. "
112
- :class = " {selected: activeTab === Tab.Runtime} "
109
+ </template >
110
+ </TabComponent >
111
+ <TabComponent
112
+ tooltip = " Runtime benchmarks: measure how long does it take to execute (i.e. how fast are) programs compiled by the compared rustc. "
113
+ title =" Runtime"
114
+ :selected = " activeTab === Tab.Runtime"
113
115
@click =" changeTab(Tab.Runtime)"
114
116
>
115
- <div class =" title" >Runtime</div >
116
- <div class =" summary table-wrapper" >
117
+ <template v-slot :summary >
117
118
<SummaryTable :summary =" runtimeSummary" />
118
- </div >
119
- </div >
120
- <div
121
- class = " tab "
122
- title =" Bootstrap duration: measures how long does it take to compile rustc by itself. "
123
- :class = " {selected: activeTab === Tab.Bootstrap} "
119
+ </template >
120
+ </TabComponent >
121
+ <TabComponent
122
+ tooltip = " Bootstrap duration: measures how long does it take to compile rustc by itself. "
123
+ title =" Bootstrap"
124
+ :selected = " activeTab === Tab.Bootstrap"
124
125
@click =" changeTab(Tab.Bootstrap)"
125
126
>
126
- <div class =" title" >Bootstrap</div >
127
- <div class =" summary" >
127
+ <template v-slot :summary >
128
128
<div >
129
129
{{ formatBootstrap(bootstrapA) }} ->
130
130
{{ formatBootstrap(bootstrapB) }}
@@ -137,17 +137,16 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
137
137
(((bootstrapB - bootstrapA) / bootstrapA) * 100).toFixed(3)
138
138
}}%)
139
139
</div >
140
- </div >
141
- </div >
142
- <div
143
- class = " tab "
144
- title =" Artifact size: sizes of individual components of the two artifacts. "
140
+ </template >
141
+ </TabComponent >
142
+ <TabComponent
143
+ tooltip = " Artifact size: sizes of individual components of the two artifacts. "
144
+ title =" Artifact size"
145
145
v-if =" sizesAvailable"
146
- :class = " {selected: activeTab === Tab.ArtifactSize} "
146
+ :selected = " activeTab === Tab.ArtifactSize"
147
147
@click =" changeTab(Tab.ArtifactSize)"
148
148
>
149
- <div class =" title" >Artifact size</div >
150
- <div class =" summary" >
149
+ <template v-slot :summary >
151
150
<div >
152
151
{{ formatArtifactSize(totalSizeA) }} ->
153
152
{{ formatArtifactSize(totalSizeB) }}
@@ -161,8 +160,8 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
161
160
formatPercentChange(totalSizeA, totalSizeB)
162
161
}})
163
162
</div >
164
- </div >
165
- </div >
163
+ </template >
164
+ </TabComponent >
166
165
</div >
167
166
</template >
168
167
@@ -180,51 +179,6 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
180
179
}
181
180
}
182
181
183
- .tab {
184
- display : flex ;
185
- flex-direction : column ;
186
- position : relative ;
187
- min-width : 200px ;
188
- min-height : 60px ;
189
- padding : 5px ;
190
- text-align : center ;
191
- border : 2px dotted #cccccc ;
192
- border-radius : 5px ;
193
- cursor : pointer ;
194
-
195
- & :hover {
196
- @extend .selected ;
197
- }
198
-
199
- @media (min-width : 600px ) {
200
- & :not (:first-child ) {
201
- margin-left : 30px ;
202
- }
203
-
204
- & :not (:last-child ) {
205
- :after {
206
- content : " " ;
207
- position : absolute ;
208
- right : -17px ;
209
- border-right : 1px solid black ;
210
- top : 20% ;
211
- bottom : 20% ;
212
- }
213
- }
214
- }
215
- }
216
-
217
- .title {
218
- font-weight : bold ;
219
- font-size : 1.1em ;
220
- margin-bottom : 5px ;
221
- }
222
-
223
- .selected {
224
- border-style : solid ;
225
- border-color : black ;
226
- }
227
-
228
182
.table-wrapper {
229
183
table {
230
184
width : 100% ;
@@ -235,12 +189,4 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
235
189
font-weight : normal ;
236
190
}
237
191
}
238
-
239
- .summary {
240
- display : flex ;
241
- flex-direction : column ;
242
- justify-content : center ;
243
- font-size : 0.9em ;
244
- flex-grow : 1 ;
245
- }
246
192
</style >
0 commit comments