Skip to content

Commit e6004e8

Browse files
committed
review comments
1 parent 23167f2 commit e6004e8

3 files changed

Lines changed: 12 additions & 5 deletions

File tree

packages/@react-native-windows/perf-testing/src/ci/BaselineComparator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ export class BaselineComparator {
106106
base.medianDuration > 0
107107
? ((head.medianDuration - base.medianDuration) / base.medianDuration) *
108108
100
109-
: 0;
109+
: head.medianDuration > 0
110+
? Infinity
111+
: 0;
110112

111113
const errors: string[] = [];
112114

packages/@react-native-windows/perf-testing/src/core/measurePerf.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,11 @@ async function runSingleMeasurement(
185185
act(() => {
186186
renderer.unmount();
187187
});
188-
} catch {
189-
// Already unmounted
188+
} catch (e: unknown) {
189+
const msg = e instanceof Error ? e.message : String(e);
190+
if (!msg.includes('unmount') && !msg.includes('not mounted')) {
191+
throw e;
192+
}
190193
}
191194

192195
// Prefer Profiler actualDuration, fallback to manual timing

vnext/Scripts/perf/compare-results.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,14 @@ function resolveThreshold(threshold) {
8888
}
8989

9090
function compareEntry(head, base, threshold) {
91-
// Use median for comparison — robust to outlier spikes
91+
// median for comparison
9292
const percentChange =
9393
base.medianDuration > 0
9494
? ((head.medianDuration - base.medianDuration) / base.medianDuration) *
9595
100
96-
: 0;
96+
: head.medianDuration > 0
97+
? Infinity
98+
: 0;
9799

98100
const errors = [];
99101

0 commit comments

Comments
 (0)