@@ -3,16 +3,28 @@ import {TestCaseComparison} from "../data";
3
3
import Tooltip from " ../tooltip.vue" ;
4
4
import {percentClass } from " ../shared" ;
5
5
import {RuntimeTestCase } from " ./common" ;
6
+ import {computed } from " vue" ;
6
7
7
8
const props = defineProps <{
8
9
comparisons: TestCaseComparison <RuntimeTestCase >[];
9
10
hasNonRelevant: boolean ;
10
11
showRawData: boolean ;
12
+ metric: string ;
11
13
}>();
12
14
13
15
function prettifyRawNumber(number : number ): string {
14
16
return number .toLocaleString ();
15
17
}
18
+
19
+ const unit = computed (() => {
20
+ // The DB stored wall-time data in nanoseconds for runtime benchmarks, so it is
21
+ // hardcoded here
22
+ if (props .metric == " wall-time" ) {
23
+ return " ns" ;
24
+ } else {
25
+ return null ;
26
+ }
27
+ });
16
28
</script >
17
29
18
30
<template >
@@ -90,14 +102,14 @@ function prettifyRawNumber(number: number): string {
90
102
</div >
91
103
</td >
92
104
<td v-if =" showRawData" class =" numeric" >
93
- <abbr :title =" comparison.datumA.toString()" >{{
94
- prettifyRawNumber(comparison.datumA)
95
- }}</ abbr >
105
+ <abbr :title =" comparison.datumA.toString()"
106
+ >{{ prettifyRawNumber(comparison.datumA) }}{{ unit }}</ abbr
107
+ >
96
108
</td >
97
109
<td v-if =" showRawData" class =" numeric" >
98
- <abbr :title =" comparison.datumB.toString()" >{{
99
- prettifyRawNumber(comparison.datumB)
100
- }}</ abbr >
110
+ <abbr :title =" comparison.datumB.toString()"
111
+ >{{ prettifyRawNumber(comparison.datumB) }}{{ unit }}</ abbr
112
+ >
101
113
</td >
102
114
</tr >
103
115
</template >
0 commit comments