@buoy-gg/benchmark 2.1.3 → 2.1.4-beta.0

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