@buoy-gg/benchmark 2.1.3 → 2.1.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/benchmarking/BenchmarkComparator.js +221 -1
- package/lib/commonjs/benchmarking/BenchmarkRecorder.js +497 -1
- package/lib/commonjs/benchmarking/BenchmarkStorage.js +235 -1
- package/lib/commonjs/benchmarking/index.js +83 -1
- package/lib/commonjs/benchmarking/types.js +13 -1
- package/lib/commonjs/components/BenchmarkCompareView.js +475 -1
- package/lib/commonjs/components/BenchmarkDetailView.js +346 -1
- package/lib/commonjs/components/BenchmarkModal.js +505 -1
- package/lib/commonjs/components/BenchmarkSessionCard.js +193 -1
- package/lib/commonjs/index.js +62 -1
- package/lib/commonjs/preset.js +86 -1
- package/lib/module/benchmarking/BenchmarkComparator.js +216 -1
- package/lib/module/benchmarking/BenchmarkRecorder.js +493 -1
- package/lib/module/benchmarking/BenchmarkStorage.js +227 -1
- package/lib/module/benchmarking/index.js +48 -1
- package/lib/module/benchmarking/types.js +13 -1
- package/lib/module/components/BenchmarkCompareView.js +469 -1
- package/lib/module/components/BenchmarkDetailView.js +340 -1
- package/lib/module/components/BenchmarkModal.js +499 -1
- package/lib/module/components/BenchmarkSessionCard.js +187 -1
- package/lib/module/index.js +39 -1
- package/lib/module/preset.js +81 -1
- package/lib/typescript/benchmarking/BenchmarkComparator.d.ts.map +1 -0
- package/lib/typescript/benchmarking/BenchmarkRecorder.d.ts.map +1 -0
- package/lib/typescript/benchmarking/BenchmarkStorage.d.ts.map +1 -0
- package/lib/typescript/benchmarking/index.d.ts.map +1 -0
- package/lib/typescript/benchmarking/types.d.ts.map +1 -0
- package/lib/typescript/components/BenchmarkCompareView.d.ts.map +1 -0
- package/lib/typescript/components/BenchmarkDetailView.d.ts.map +1 -0
- package/lib/typescript/components/BenchmarkModal.d.ts.map +1 -0
- package/lib/typescript/components/BenchmarkSessionCard.d.ts.map +1 -0
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/preset.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1,475 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BenchmarkCompareView=BenchmarkCompareView,exports.default=void 0;var _react=_interopRequireDefault(require("react")),_reactNative=require("react-native"),_sharedUi=require("@buoy-gg/shared-ui"),_benchmarking=require("../benchmarking"),_jsxRuntime=require("react/jsx-runtime");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function formatMs(e){return e<1?`${(1e3*e).toFixed(0)}μs`:e<10?`${e.toFixed(2)}ms`:e<100?`${e.toFixed(1)}ms`:`${e.toFixed(0)}ms`}function formatPercent(e){return`${e>=0?"+":""}${e.toFixed(1)}%`}function getImprovementColor(e){return e>5?_sharedUi.macOSColors.semantic.success:e<-5?_sharedUi.macOSColors.semantic.error:_sharedUi.macOSColors.text.secondary}function getIndicator(e){return e>5?"✅":e<-5?"❌":"➖"}function SectionHeader({title:e}){return(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.sectionHeader,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.sectionTitle,children:e})})}function CompareRow({label:e,baseline:t,comparison:s,improvement:a,unit:r="ms"}){return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.compareRow,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.compareLabel,children:e}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.compareValues,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.baselineValue,children:t}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.arrow,children:"→"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.comparisonValue,children:s}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.improvementValue,{color:getImprovementColor(a)}],children:[formatPercent(a)," ",getIndicator(a)]})]})]})}function BenchmarkCompareView({baseline:e,comparison:t}){const s=_benchmarking.BenchmarkComparator.compare(e,t);return(0,_jsxRuntime.jsxs)(_reactNative.ScrollView,{style:styles.container,contentContainerStyle:styles.content,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.overallResult,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.overallEmoji,children:s.isImproved?"🎉":"⚠️"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.overallText,children:s.isImproved?"IMPROVED":"REGRESSED"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:[styles.overallPercent,{color:getImprovementColor(s.overallImprovement)}],children:formatPercent(s.overallImprovement)})]}),(0,_jsxRuntime.jsx)(SectionHeader,{title:"COMPARING"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.reportInfo,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reportRole,children:"BASELINE"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reportName,children:e.name}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reportDate,children:new Date(e.createdAt).toLocaleString()})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.vsContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.vsText,children:"vs"})}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.reportInfo,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reportRole,children:"COMPARISON"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reportName,children:t.name}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.reportDate,children:new Date(t.createdAt).toLocaleString()})]})]}),(0,_jsxRuntime.jsx)(SectionHeader,{title:"TIMING COMPARISON"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.columnHeaders,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.columnLabel,children:"Metric"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.columnValues,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.columnHeader,children:"Base"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.columnHeader}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.columnHeader,children:"After"}),(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.columnHeader,children:"Change"})]})]}),(0,_jsxRuntime.jsx)(CompareRow,{label:"Measure Time",baseline:formatMs(e.stats.avgMeasureTime),comparison:formatMs(t.stats.avgMeasureTime),improvement:s.measureTimeImprovement}),(0,_jsxRuntime.jsx)(CompareRow,{label:"Pipeline Time",baseline:formatMs(e.stats.avgTotalTime),comparison:formatMs(t.stats.avgTotalTime),improvement:s.pipelineTimeImprovement}),(0,_jsxRuntime.jsx)(CompareRow,{label:"Filter Time",baseline:formatMs(e.stats.avgFilterTime),comparison:formatMs(t.stats.avgFilterTime),improvement:s.filterTimeImprovement}),(0,_jsxRuntime.jsx)(CompareRow,{label:"Track Time",baseline:formatMs(e.stats.avgTrackTime),comparison:formatMs(t.stats.avgTrackTime),improvement:s.trackTimeImprovement}),(0,_jsxRuntime.jsx)(CompareRow,{label:"Overlay Render",baseline:formatMs(e.stats.avgOverlayRenderTime),comparison:formatMs(t.stats.avgOverlayRenderTime),improvement:s.overlayRenderImprovement})]}),(0,_jsxRuntime.jsx)(SectionHeader,{title:"PERCENTILES"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsx)(CompareRow,{label:"P50 (Median)",baseline:formatMs(e.stats.p50TotalTime),comparison:formatMs(t.stats.p50TotalTime),improvement:e.stats.p50TotalTime>0?(e.stats.p50TotalTime-t.stats.p50TotalTime)/e.stats.p50TotalTime*100:0}),(0,_jsxRuntime.jsx)(CompareRow,{label:"P95",baseline:formatMs(e.stats.p95TotalTime),comparison:formatMs(t.stats.p95TotalTime),improvement:e.stats.p95TotalTime>0?(e.stats.p95TotalTime-t.stats.p95TotalTime)/e.stats.p95TotalTime*100:0}),(0,_jsxRuntime.jsx)(CompareRow,{label:"P99",baseline:formatMs(e.stats.p99TotalTime),comparison:formatMs(t.stats.p99TotalTime),improvement:e.stats.p99TotalTime>0?(e.stats.p99TotalTime-t.stats.p99TotalTime)/e.stats.p99TotalTime*100:0})]}),(0,_jsxRuntime.jsx)(SectionHeader,{title:"BATCH STATISTICS"}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.section,children:[(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.statComparison,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statLabel,children:"Total Batches"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.statValues,children:[e.stats.batchCount," → ",t.stats.batchCount]})]}),(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.statComparison,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statLabel,children:"Nodes Processed"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.statValues,children:[e.stats.totalNodesProcessed.toLocaleString()," →"," ",t.stats.totalNodesProcessed.toLocaleString()]})]})]}),null!=e.memoryDelta&&null!=t.memoryDelta&&(0,_jsxRuntime.jsxs)(_jsxRuntime.Fragment,{children:[(0,_jsxRuntime.jsx)(SectionHeader,{title:"MEMORY"}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.section,children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:styles.statComparison,children:[(0,_jsxRuntime.jsx)(_reactNative.Text,{style:styles.statLabel,children:"Memory Delta"}),(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:[styles.statValues,{color:null!=s.memoryDeltaChange&&s.memoryDeltaChange<0?_sharedUi.macOSColors.semantic.success:_sharedUi.macOSColors.text.primary}],children:[(e.memoryDelta/1024/1024).toFixed(2),"MB →"," ",(t.memoryDelta/1024/1024).toFixed(2),"MB"]})]})})]}),(0,_jsxRuntime.jsx)(_reactNative.View,{style:styles.footer,children:(0,_jsxRuntime.jsxs)(_reactNative.Text,{style:styles.footerText,children:["Compared at ",new Date(s.comparedAt).toLocaleString()]})})]})}const styles=_reactNative.StyleSheet.create({container:{flex:1},content:{paddingVertical:16},overallResult:{alignItems:"center",paddingVertical:24,backgroundColor:_sharedUi.macOSColors.background.card,marginHorizontal:16,borderRadius:12,borderWidth:1,borderColor:_sharedUi.macOSColors.border.default,marginBottom:16},overallEmoji:{fontSize:32,marginBottom:8},overallText:{fontSize:14,fontWeight:"700",color:_sharedUi.macOSColors.text.primary,fontFamily:"monospace",letterSpacing:2,marginBottom:4},overallPercent:{fontSize:24,fontWeight:"700",fontFamily:"monospace"},sectionHeader:{paddingHorizontal:16,paddingVertical:8,backgroundColor:_sharedUi.macOSColors.background.hover,borderTopWidth:1,borderBottomWidth:1,borderColor:_sharedUi.macOSColors.border.default,marginTop:8},sectionTitle:{fontSize:11,fontWeight:"600",color:_sharedUi.macOSColors.text.secondary,fontFamily:"monospace",letterSpacing:1},section:{paddingHorizontal:16,paddingVertical:8},reportInfo:{flex:1,paddingVertical:8},reportRole:{fontSize:10,fontWeight:"600",color:_sharedUi.macOSColors.text.muted,fontFamily:"monospace",letterSpacing:1,marginBottom:4},reportName:{fontSize:13,fontWeight:"600",color:_sharedUi.macOSColors.text.primary,fontFamily:"monospace",marginBottom:2},reportDate:{fontSize:11,color:_sharedUi.macOSColors.text.secondary,fontFamily:"monospace"},vsContainer:{paddingHorizontal:16,justifyContent:"center"},vsText:{fontSize:12,color:_sharedUi.macOSColors.text.muted,fontFamily:"monospace"},columnHeaders:{flexDirection:"row",justifyContent:"space-between",paddingBottom:8,borderBottomWidth:1,borderColor:_sharedUi.macOSColors.border.default,marginBottom:8},columnLabel:{fontSize:10,color:_sharedUi.macOSColors.text.muted,fontFamily:"monospace",width:80},columnValues:{flexDirection:"row",flex:1,justifyContent:"flex-end",gap:8},columnHeader:{fontSize:10,color:_sharedUi.macOSColors.text.muted,fontFamily:"monospace",width:50,textAlign:"center"},compareRow:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:8},compareLabel:{fontSize:12,color:_sharedUi.macOSColors.text.secondary,fontFamily:"monospace",width:80},compareValues:{flexDirection:"row",alignItems:"center",flex:1,justifyContent:"flex-end",gap:4},baselineValue:{fontSize:11,color:_sharedUi.macOSColors.text.muted,fontFamily:"monospace",width:50,textAlign:"right"},arrow:{fontSize:11,color:_sharedUi.macOSColors.text.muted,paddingHorizontal:4},comparisonValue:{fontSize:11,color:_sharedUi.macOSColors.text.primary,fontFamily:"monospace",fontWeight:"500",width:50,textAlign:"right"},improvementValue:{fontSize:11,fontFamily:"monospace",fontWeight:"600",width:70,textAlign:"right"},statComparison:{flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingVertical:6},statLabel:{fontSize:12,color:_sharedUi.macOSColors.text.secondary,fontFamily:"monospace"},statValues:{fontSize:12,color:_sharedUi.macOSColors.text.primary,fontFamily:"monospace"},footer:{paddingHorizontal:16,paddingVertical:16,marginTop:16,borderTopWidth:1,borderColor:_sharedUi.macOSColors.border.default},footerText:{fontSize:10,color:_sharedUi.macOSColors.text.muted,fontFamily:"monospace",textAlign:"center"}});var _default=exports.default=BenchmarkCompareView;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.BenchmarkCompareView = BenchmarkCompareView;
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _reactNative = require("react-native");
|
|
10
|
+
var _sharedUi = require("@buoy-gg/shared-ui");
|
|
11
|
+
var _benchmarking = require("../benchmarking");
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
/**
|
|
15
|
+
* BenchmarkCompareView
|
|
16
|
+
*
|
|
17
|
+
* Displays a comparison between two benchmark reports.
|
|
18
|
+
* Shows side-by-side metrics with improvement/regression indicators.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Format milliseconds with appropriate precision
|
|
23
|
+
*/
|
|
24
|
+
function formatMs(ms) {
|
|
25
|
+
if (ms < 1) return `${(ms * 1000).toFixed(0)}μs`;
|
|
26
|
+
if (ms < 10) return `${ms.toFixed(2)}ms`;
|
|
27
|
+
if (ms < 100) return `${ms.toFixed(1)}ms`;
|
|
28
|
+
return `${ms.toFixed(0)}ms`;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Format percentage with sign
|
|
33
|
+
*/
|
|
34
|
+
function formatPercent(value) {
|
|
35
|
+
const sign = value >= 0 ? "+" : "";
|
|
36
|
+
return `${sign}${value.toFixed(1)}%`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Get color based on improvement (positive = good)
|
|
41
|
+
*/
|
|
42
|
+
function getImprovementColor(improvement) {
|
|
43
|
+
if (improvement > 5) return _sharedUi.macOSColors.semantic.success;
|
|
44
|
+
if (improvement < -5) return _sharedUi.macOSColors.semantic.error;
|
|
45
|
+
return _sharedUi.macOSColors.text.secondary;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get emoji indicator
|
|
50
|
+
*/
|
|
51
|
+
function getIndicator(improvement) {
|
|
52
|
+
if (improvement > 5) return "✅";
|
|
53
|
+
if (improvement < -5) return "❌";
|
|
54
|
+
return "➖";
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Section header component
|
|
59
|
+
*/
|
|
60
|
+
function SectionHeader({
|
|
61
|
+
title
|
|
62
|
+
}) {
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
64
|
+
style: styles.sectionHeader,
|
|
65
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
66
|
+
style: styles.sectionTitle,
|
|
67
|
+
children: title
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Comparison row component
|
|
74
|
+
*/
|
|
75
|
+
function CompareRow({
|
|
76
|
+
label,
|
|
77
|
+
baseline,
|
|
78
|
+
comparison,
|
|
79
|
+
improvement,
|
|
80
|
+
unit = "ms"
|
|
81
|
+
}) {
|
|
82
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
83
|
+
style: styles.compareRow,
|
|
84
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
85
|
+
style: styles.compareLabel,
|
|
86
|
+
children: label
|
|
87
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
88
|
+
style: styles.compareValues,
|
|
89
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
90
|
+
style: styles.baselineValue,
|
|
91
|
+
children: baseline
|
|
92
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
93
|
+
style: styles.arrow,
|
|
94
|
+
children: "\u2192"
|
|
95
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
96
|
+
style: styles.comparisonValue,
|
|
97
|
+
children: comparison
|
|
98
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
99
|
+
style: [styles.improvementValue, {
|
|
100
|
+
color: getImprovementColor(improvement)
|
|
101
|
+
}],
|
|
102
|
+
children: [formatPercent(improvement), " ", getIndicator(improvement)]
|
|
103
|
+
})]
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
function BenchmarkCompareView({
|
|
108
|
+
baseline,
|
|
109
|
+
comparison
|
|
110
|
+
}) {
|
|
111
|
+
// Generate comparison data
|
|
112
|
+
const result = _benchmarking.BenchmarkComparator.compare(baseline, comparison);
|
|
113
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.ScrollView, {
|
|
114
|
+
style: styles.container,
|
|
115
|
+
contentContainerStyle: styles.content,
|
|
116
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
117
|
+
style: styles.overallResult,
|
|
118
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
119
|
+
style: styles.overallEmoji,
|
|
120
|
+
children: result.isImproved ? "🎉" : "⚠️"
|
|
121
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
122
|
+
style: styles.overallText,
|
|
123
|
+
children: result.isImproved ? "IMPROVED" : "REGRESSED"
|
|
124
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
125
|
+
style: [styles.overallPercent, {
|
|
126
|
+
color: getImprovementColor(result.overallImprovement)
|
|
127
|
+
}],
|
|
128
|
+
children: formatPercent(result.overallImprovement)
|
|
129
|
+
})]
|
|
130
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeader, {
|
|
131
|
+
title: "COMPARING"
|
|
132
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
133
|
+
style: styles.section,
|
|
134
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
135
|
+
style: styles.reportInfo,
|
|
136
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
137
|
+
style: styles.reportRole,
|
|
138
|
+
children: "BASELINE"
|
|
139
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
140
|
+
style: styles.reportName,
|
|
141
|
+
children: baseline.name
|
|
142
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
143
|
+
style: styles.reportDate,
|
|
144
|
+
children: new Date(baseline.createdAt).toLocaleString()
|
|
145
|
+
})]
|
|
146
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
147
|
+
style: styles.vsContainer,
|
|
148
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
149
|
+
style: styles.vsText,
|
|
150
|
+
children: "vs"
|
|
151
|
+
})
|
|
152
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
153
|
+
style: styles.reportInfo,
|
|
154
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
155
|
+
style: styles.reportRole,
|
|
156
|
+
children: "COMPARISON"
|
|
157
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
158
|
+
style: styles.reportName,
|
|
159
|
+
children: comparison.name
|
|
160
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
161
|
+
style: styles.reportDate,
|
|
162
|
+
children: new Date(comparison.createdAt).toLocaleString()
|
|
163
|
+
})]
|
|
164
|
+
})]
|
|
165
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeader, {
|
|
166
|
+
title: "TIMING COMPARISON"
|
|
167
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
168
|
+
style: styles.section,
|
|
169
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
170
|
+
style: styles.columnHeaders,
|
|
171
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
172
|
+
style: styles.columnLabel,
|
|
173
|
+
children: "Metric"
|
|
174
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
175
|
+
style: styles.columnValues,
|
|
176
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
177
|
+
style: styles.columnHeader,
|
|
178
|
+
children: "Base"
|
|
179
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
180
|
+
style: styles.columnHeader
|
|
181
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
182
|
+
style: styles.columnHeader,
|
|
183
|
+
children: "After"
|
|
184
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
185
|
+
style: styles.columnHeader,
|
|
186
|
+
children: "Change"
|
|
187
|
+
})]
|
|
188
|
+
})]
|
|
189
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CompareRow, {
|
|
190
|
+
label: "Measure Time",
|
|
191
|
+
baseline: formatMs(baseline.stats.avgMeasureTime),
|
|
192
|
+
comparison: formatMs(comparison.stats.avgMeasureTime),
|
|
193
|
+
improvement: result.measureTimeImprovement
|
|
194
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CompareRow, {
|
|
195
|
+
label: "Pipeline Time",
|
|
196
|
+
baseline: formatMs(baseline.stats.avgTotalTime),
|
|
197
|
+
comparison: formatMs(comparison.stats.avgTotalTime),
|
|
198
|
+
improvement: result.pipelineTimeImprovement
|
|
199
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CompareRow, {
|
|
200
|
+
label: "Filter Time",
|
|
201
|
+
baseline: formatMs(baseline.stats.avgFilterTime),
|
|
202
|
+
comparison: formatMs(comparison.stats.avgFilterTime),
|
|
203
|
+
improvement: result.filterTimeImprovement
|
|
204
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CompareRow, {
|
|
205
|
+
label: "Track Time",
|
|
206
|
+
baseline: formatMs(baseline.stats.avgTrackTime),
|
|
207
|
+
comparison: formatMs(comparison.stats.avgTrackTime),
|
|
208
|
+
improvement: result.trackTimeImprovement
|
|
209
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CompareRow, {
|
|
210
|
+
label: "Overlay Render",
|
|
211
|
+
baseline: formatMs(baseline.stats.avgOverlayRenderTime),
|
|
212
|
+
comparison: formatMs(comparison.stats.avgOverlayRenderTime),
|
|
213
|
+
improvement: result.overlayRenderImprovement
|
|
214
|
+
})]
|
|
215
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeader, {
|
|
216
|
+
title: "PERCENTILES"
|
|
217
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
218
|
+
style: styles.section,
|
|
219
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(CompareRow, {
|
|
220
|
+
label: "P50 (Median)",
|
|
221
|
+
baseline: formatMs(baseline.stats.p50TotalTime),
|
|
222
|
+
comparison: formatMs(comparison.stats.p50TotalTime),
|
|
223
|
+
improvement: baseline.stats.p50TotalTime > 0 ? (baseline.stats.p50TotalTime - comparison.stats.p50TotalTime) / baseline.stats.p50TotalTime * 100 : 0
|
|
224
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CompareRow, {
|
|
225
|
+
label: "P95",
|
|
226
|
+
baseline: formatMs(baseline.stats.p95TotalTime),
|
|
227
|
+
comparison: formatMs(comparison.stats.p95TotalTime),
|
|
228
|
+
improvement: baseline.stats.p95TotalTime > 0 ? (baseline.stats.p95TotalTime - comparison.stats.p95TotalTime) / baseline.stats.p95TotalTime * 100 : 0
|
|
229
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(CompareRow, {
|
|
230
|
+
label: "P99",
|
|
231
|
+
baseline: formatMs(baseline.stats.p99TotalTime),
|
|
232
|
+
comparison: formatMs(comparison.stats.p99TotalTime),
|
|
233
|
+
improvement: baseline.stats.p99TotalTime > 0 ? (baseline.stats.p99TotalTime - comparison.stats.p99TotalTime) / baseline.stats.p99TotalTime * 100 : 0
|
|
234
|
+
})]
|
|
235
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeader, {
|
|
236
|
+
title: "BATCH STATISTICS"
|
|
237
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
238
|
+
style: styles.section,
|
|
239
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
240
|
+
style: styles.statComparison,
|
|
241
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
242
|
+
style: styles.statLabel,
|
|
243
|
+
children: "Total Batches"
|
|
244
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
245
|
+
style: styles.statValues,
|
|
246
|
+
children: [baseline.stats.batchCount, " \u2192 ", comparison.stats.batchCount]
|
|
247
|
+
})]
|
|
248
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
249
|
+
style: styles.statComparison,
|
|
250
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
251
|
+
style: styles.statLabel,
|
|
252
|
+
children: "Nodes Processed"
|
|
253
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
254
|
+
style: styles.statValues,
|
|
255
|
+
children: [baseline.stats.totalNodesProcessed.toLocaleString(), " \u2192", " ", comparison.stats.totalNodesProcessed.toLocaleString()]
|
|
256
|
+
})]
|
|
257
|
+
})]
|
|
258
|
+
}), baseline.memoryDelta != null && comparison.memoryDelta != null && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
259
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(SectionHeader, {
|
|
260
|
+
title: "MEMORY"
|
|
261
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
262
|
+
style: styles.section,
|
|
263
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
264
|
+
style: styles.statComparison,
|
|
265
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
266
|
+
style: styles.statLabel,
|
|
267
|
+
children: "Memory Delta"
|
|
268
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
269
|
+
style: [styles.statValues, {
|
|
270
|
+
color: result.memoryDeltaChange != null && result.memoryDeltaChange < 0 ? _sharedUi.macOSColors.semantic.success : _sharedUi.macOSColors.text.primary
|
|
271
|
+
}],
|
|
272
|
+
children: [(baseline.memoryDelta / 1024 / 1024).toFixed(2), "MB \u2192", " ", (comparison.memoryDelta / 1024 / 1024).toFixed(2), "MB"]
|
|
273
|
+
})]
|
|
274
|
+
})
|
|
275
|
+
})]
|
|
276
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
277
|
+
style: styles.footer,
|
|
278
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
|
|
279
|
+
style: styles.footerText,
|
|
280
|
+
children: ["Compared at ", new Date(result.comparedAt).toLocaleString()]
|
|
281
|
+
})
|
|
282
|
+
})]
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
const styles = _reactNative.StyleSheet.create({
|
|
286
|
+
container: {
|
|
287
|
+
flex: 1
|
|
288
|
+
},
|
|
289
|
+
content: {
|
|
290
|
+
paddingVertical: 16
|
|
291
|
+
},
|
|
292
|
+
overallResult: {
|
|
293
|
+
alignItems: "center",
|
|
294
|
+
paddingVertical: 24,
|
|
295
|
+
backgroundColor: _sharedUi.macOSColors.background.card,
|
|
296
|
+
marginHorizontal: 16,
|
|
297
|
+
borderRadius: 12,
|
|
298
|
+
borderWidth: 1,
|
|
299
|
+
borderColor: _sharedUi.macOSColors.border.default,
|
|
300
|
+
marginBottom: 16
|
|
301
|
+
},
|
|
302
|
+
overallEmoji: {
|
|
303
|
+
fontSize: 32,
|
|
304
|
+
marginBottom: 8
|
|
305
|
+
},
|
|
306
|
+
overallText: {
|
|
307
|
+
fontSize: 14,
|
|
308
|
+
fontWeight: "700",
|
|
309
|
+
color: _sharedUi.macOSColors.text.primary,
|
|
310
|
+
fontFamily: "monospace",
|
|
311
|
+
letterSpacing: 2,
|
|
312
|
+
marginBottom: 4
|
|
313
|
+
},
|
|
314
|
+
overallPercent: {
|
|
315
|
+
fontSize: 24,
|
|
316
|
+
fontWeight: "700",
|
|
317
|
+
fontFamily: "monospace"
|
|
318
|
+
},
|
|
319
|
+
sectionHeader: {
|
|
320
|
+
paddingHorizontal: 16,
|
|
321
|
+
paddingVertical: 8,
|
|
322
|
+
backgroundColor: _sharedUi.macOSColors.background.hover,
|
|
323
|
+
borderTopWidth: 1,
|
|
324
|
+
borderBottomWidth: 1,
|
|
325
|
+
borderColor: _sharedUi.macOSColors.border.default,
|
|
326
|
+
marginTop: 8
|
|
327
|
+
},
|
|
328
|
+
sectionTitle: {
|
|
329
|
+
fontSize: 11,
|
|
330
|
+
fontWeight: "600",
|
|
331
|
+
color: _sharedUi.macOSColors.text.secondary,
|
|
332
|
+
fontFamily: "monospace",
|
|
333
|
+
letterSpacing: 1
|
|
334
|
+
},
|
|
335
|
+
section: {
|
|
336
|
+
paddingHorizontal: 16,
|
|
337
|
+
paddingVertical: 8
|
|
338
|
+
},
|
|
339
|
+
reportInfo: {
|
|
340
|
+
flex: 1,
|
|
341
|
+
paddingVertical: 8
|
|
342
|
+
},
|
|
343
|
+
reportRole: {
|
|
344
|
+
fontSize: 10,
|
|
345
|
+
fontWeight: "600",
|
|
346
|
+
color: _sharedUi.macOSColors.text.muted,
|
|
347
|
+
fontFamily: "monospace",
|
|
348
|
+
letterSpacing: 1,
|
|
349
|
+
marginBottom: 4
|
|
350
|
+
},
|
|
351
|
+
reportName: {
|
|
352
|
+
fontSize: 13,
|
|
353
|
+
fontWeight: "600",
|
|
354
|
+
color: _sharedUi.macOSColors.text.primary,
|
|
355
|
+
fontFamily: "monospace",
|
|
356
|
+
marginBottom: 2
|
|
357
|
+
},
|
|
358
|
+
reportDate: {
|
|
359
|
+
fontSize: 11,
|
|
360
|
+
color: _sharedUi.macOSColors.text.secondary,
|
|
361
|
+
fontFamily: "monospace"
|
|
362
|
+
},
|
|
363
|
+
vsContainer: {
|
|
364
|
+
paddingHorizontal: 16,
|
|
365
|
+
justifyContent: "center"
|
|
366
|
+
},
|
|
367
|
+
vsText: {
|
|
368
|
+
fontSize: 12,
|
|
369
|
+
color: _sharedUi.macOSColors.text.muted,
|
|
370
|
+
fontFamily: "monospace"
|
|
371
|
+
},
|
|
372
|
+
columnHeaders: {
|
|
373
|
+
flexDirection: "row",
|
|
374
|
+
justifyContent: "space-between",
|
|
375
|
+
paddingBottom: 8,
|
|
376
|
+
borderBottomWidth: 1,
|
|
377
|
+
borderColor: _sharedUi.macOSColors.border.default,
|
|
378
|
+
marginBottom: 8
|
|
379
|
+
},
|
|
380
|
+
columnLabel: {
|
|
381
|
+
fontSize: 10,
|
|
382
|
+
color: _sharedUi.macOSColors.text.muted,
|
|
383
|
+
fontFamily: "monospace",
|
|
384
|
+
width: 80
|
|
385
|
+
},
|
|
386
|
+
columnValues: {
|
|
387
|
+
flexDirection: "row",
|
|
388
|
+
flex: 1,
|
|
389
|
+
justifyContent: "flex-end",
|
|
390
|
+
gap: 8
|
|
391
|
+
},
|
|
392
|
+
columnHeader: {
|
|
393
|
+
fontSize: 10,
|
|
394
|
+
color: _sharedUi.macOSColors.text.muted,
|
|
395
|
+
fontFamily: "monospace",
|
|
396
|
+
width: 50,
|
|
397
|
+
textAlign: "center"
|
|
398
|
+
},
|
|
399
|
+
compareRow: {
|
|
400
|
+
flexDirection: "row",
|
|
401
|
+
justifyContent: "space-between",
|
|
402
|
+
alignItems: "center",
|
|
403
|
+
paddingVertical: 8
|
|
404
|
+
},
|
|
405
|
+
compareLabel: {
|
|
406
|
+
fontSize: 12,
|
|
407
|
+
color: _sharedUi.macOSColors.text.secondary,
|
|
408
|
+
fontFamily: "monospace",
|
|
409
|
+
width: 80
|
|
410
|
+
},
|
|
411
|
+
compareValues: {
|
|
412
|
+
flexDirection: "row",
|
|
413
|
+
alignItems: "center",
|
|
414
|
+
flex: 1,
|
|
415
|
+
justifyContent: "flex-end",
|
|
416
|
+
gap: 4
|
|
417
|
+
},
|
|
418
|
+
baselineValue: {
|
|
419
|
+
fontSize: 11,
|
|
420
|
+
color: _sharedUi.macOSColors.text.muted,
|
|
421
|
+
fontFamily: "monospace",
|
|
422
|
+
width: 50,
|
|
423
|
+
textAlign: "right"
|
|
424
|
+
},
|
|
425
|
+
arrow: {
|
|
426
|
+
fontSize: 11,
|
|
427
|
+
color: _sharedUi.macOSColors.text.muted,
|
|
428
|
+
paddingHorizontal: 4
|
|
429
|
+
},
|
|
430
|
+
comparisonValue: {
|
|
431
|
+
fontSize: 11,
|
|
432
|
+
color: _sharedUi.macOSColors.text.primary,
|
|
433
|
+
fontFamily: "monospace",
|
|
434
|
+
fontWeight: "500",
|
|
435
|
+
width: 50,
|
|
436
|
+
textAlign: "right"
|
|
437
|
+
},
|
|
438
|
+
improvementValue: {
|
|
439
|
+
fontSize: 11,
|
|
440
|
+
fontFamily: "monospace",
|
|
441
|
+
fontWeight: "600",
|
|
442
|
+
width: 70,
|
|
443
|
+
textAlign: "right"
|
|
444
|
+
},
|
|
445
|
+
statComparison: {
|
|
446
|
+
flexDirection: "row",
|
|
447
|
+
justifyContent: "space-between",
|
|
448
|
+
alignItems: "center",
|
|
449
|
+
paddingVertical: 6
|
|
450
|
+
},
|
|
451
|
+
statLabel: {
|
|
452
|
+
fontSize: 12,
|
|
453
|
+
color: _sharedUi.macOSColors.text.secondary,
|
|
454
|
+
fontFamily: "monospace"
|
|
455
|
+
},
|
|
456
|
+
statValues: {
|
|
457
|
+
fontSize: 12,
|
|
458
|
+
color: _sharedUi.macOSColors.text.primary,
|
|
459
|
+
fontFamily: "monospace"
|
|
460
|
+
},
|
|
461
|
+
footer: {
|
|
462
|
+
paddingHorizontal: 16,
|
|
463
|
+
paddingVertical: 16,
|
|
464
|
+
marginTop: 16,
|
|
465
|
+
borderTopWidth: 1,
|
|
466
|
+
borderColor: _sharedUi.macOSColors.border.default
|
|
467
|
+
},
|
|
468
|
+
footerText: {
|
|
469
|
+
fontSize: 10,
|
|
470
|
+
color: _sharedUi.macOSColors.text.muted,
|
|
471
|
+
fontFamily: "monospace",
|
|
472
|
+
textAlign: "center"
|
|
473
|
+
}
|
|
474
|
+
});
|
|
475
|
+
var _default = exports.default = BenchmarkCompareView;
|