@@ -10,6 +10,7 @@ import {
1010import {SummaryGroup } from " ./data" ;
1111import SummaryPercentValue from " ./summary/percent-value.vue" ;
1212import SummaryRange from " ./summary/range.vue" ;
13+ import TabComponent from " ../../components/tab.vue" ;
1314
1415const props = withDefaults (
1516 defineProps <{
@@ -42,27 +43,29 @@ function SummaryTable({summary}: {summary: SummaryGroup}) {
4243 const valid = summary .all .count > 0 ;
4344 if (valid ) {
4445 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 >
6669 );
6770 }
6871 return <div >No results</div >;
@@ -95,36 +98,33 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
9598
9699<template >
97100 <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"
102105 @click =" changeTab(Tab.CompileTime)"
103106 >
104- <div class =" title" >Compile-time</div >
105- <div class =" summary table-wrapper" >
107+ <template v-slot :summary >
106108 <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"
113115 @click =" changeTab(Tab.Runtime)"
114116 >
115- <div class =" title" >Runtime</div >
116- <div class =" summary table-wrapper" >
117+ <template v-slot :summary >
117118 <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"
124125 @click =" changeTab(Tab.Bootstrap)"
125126 >
126- <div class =" title" >Bootstrap</div >
127- <div class =" summary" >
127+ <template v-slot :summary >
128128 <div >
129129 {{ formatBootstrap(bootstrapA) }} ->
130130 {{ formatBootstrap(bootstrapB) }}
@@ -137,17 +137,16 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
137137 (((bootstrapB - bootstrapA) / bootstrapA) * 100).toFixed(3)
138138 }}%)
139139 </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"
145145 v-if =" sizesAvailable"
146- :class = " {selected: activeTab === Tab.ArtifactSize} "
146+ :selected = " activeTab === Tab.ArtifactSize"
147147 @click =" changeTab(Tab.ArtifactSize)"
148148 >
149- <div class =" title" >Artifact size</div >
150- <div class =" summary" >
149+ <template v-slot :summary >
151150 <div >
152151 {{ formatArtifactSize(totalSizeA) }} ->
153152 {{ formatArtifactSize(totalSizeB) }}
@@ -161,8 +160,8 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
161160 formatPercentChange(totalSizeA, totalSizeB)
162161 }})
163162 </div >
164- </div >
165- </div >
163+ </template >
164+ </TabComponent >
166165 </div >
167166</template >
168167
@@ -180,51 +179,6 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
180179 }
181180}
182181
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-
228182.table-wrapper {
229183 table {
230184 width : 100% ;
@@ -235,12 +189,4 @@ const activeTab: Ref<Tab> = ref(props.initialTab);
235189 font-weight : normal ;
236190 }
237191}
238-
239- .summary {
240- display : flex ;
241- flex-direction : column ;
242- justify-content : center ;
243- font-size : 0.9em ;
244- flex-grow : 1 ;
245- }
246192 </style >
0 commit comments