@@ -3,16 +3,28 @@ import {TestCaseComparison} from "../data";
33import Tooltip from " ../tooltip.vue" ;
44import {percentClass } from " ../shared" ;
55import {RuntimeTestCase } from " ./common" ;
6+ import {computed } from " vue" ;
67
78const props = defineProps <{
89 comparisons: TestCaseComparison <RuntimeTestCase >[];
910 hasNonRelevant: boolean ;
1011 showRawData: boolean ;
12+ metric: string ;
1113}>();
1214
1315function prettifyRawNumber(number : number ): string {
1416 return number .toLocaleString ();
1517}
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+ });
1628 </script >
1729
1830<template >
@@ -90,14 +102,14 @@ function prettifyRawNumber(number: number): string {
90102 </div >
91103 </td >
92104 <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+ >
96108 </td >
97109 <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+ >
101113 </td >
102114 </tr >
103115 </template >
0 commit comments