11<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" ;
77import {computed } from " vue" ;
8+ import {useExpandedStore } from " ./expansion" ;
9+ import BenchmarkDetail from " ./benchmark-detail.vue" ;
810
911const props = defineProps <{
1012 id: string ;
@@ -60,40 +62,13 @@ function prettifyRawNumber(number: number): string {
6062 return number .toLocaleString ();
6163}
6264
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 ;
6769 }
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+ });
9772const unit = computed (() => {
9873 // The DB stored wall-time data in seconds for compile benchmarks, so it is
9974 // hardcoded here
@@ -103,6 +78,7 @@ const unit = computed(() => {
10378 return null ;
10479 }
10580});
81+ const {toggleExpanded, isExpanded} = useExpandedStore ();
10682 </script >
10783
10884<template >
@@ -114,11 +90,12 @@ const unit = computed(() => {
11490 <table v-else class =" benches compare" >
11591 <thead >
11692 <tr >
93+ <th class =" toggle" ></th >
11794 <th >Benchmark</th >
11895 <th >Profile</th >
11996 <th >Scenario</th >
12097 <th >% Change</th >
121- <th >
98+ <th class = " narrow " >
12299 Significance Threshold
123100 <Tooltip >
124101 The minimum % change that is considered significant. The higher
@@ -132,7 +109,7 @@ const unit = computed(() => {
132109 how the significance threshold is calculated.
133110 </Tooltip >
134111 </th >
135- <th >
112+ <th class = " narrow " >
136113 Significance Factor
137114 <Tooltip >
138115 How much a particular result is over the significance threshold. A
@@ -147,7 +124,10 @@ const unit = computed(() => {
147124 <tbody >
148125 <template v-for =" comparison in comparisons " >
149126 <tr >
150- <td :title =" generateBenchmarkTooltip(comparison.testCase)" >
127+ <td @click =" toggleExpanded(comparison.testCase)" class =" toggle" >
128+ {{ isExpanded(comparison.testCase) ? "▼" : "▶" }}
129+ </td >
130+ <td >
151131 <a
152132 v-bind:href =" benchmarkLink(comparison.testCase.benchmark)"
153133 class =" silent-link"
@@ -181,7 +161,7 @@ const unit = computed(() => {
181161 </div >
182162 </div >
183163 </td >
184- <td >
164+ <td class = " narrow " >
185165 <div class =" numeric-aligned" >
186166 <div >
187167 {{
@@ -192,7 +172,7 @@ const unit = computed(() => {
192172 </div >
193173 </div >
194174 </td >
195- <td >
175+ <td class = " narrow " >
196176 <div class =" numeric-aligned" >
197177 <div >
198178 {{
@@ -218,6 +198,14 @@ const unit = computed(() => {
218198 </a >
219199 </td >
220200 </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 >
221209 </template >
222210 </tbody >
223211 </table >
@@ -226,8 +214,9 @@ const unit = computed(() => {
226214
227215<style scoped lang="scss">
228216.benches {
217+ width : 100% ;
218+ table-layout : auto ;
229219 font-size : medium ;
230- table-layout : fixed ;
231220
232221 td ,
233222 th {
@@ -249,15 +238,22 @@ const unit = computed(() => {
249238 border-right : dotted 1px ;
250239}
251240
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+ }
255254}
256255
257256.benches td {
258- text-align : center ;
259- width : 25% ;
260-
261257 & > .numeric-aligned {
262258 display : flex ;
263259 flex-direction : column ;
0 commit comments