Skip to content

Commit c482b93

Browse files
rubennortemeta-codesync[bot]
authored andcommitted
Skip reporting benchmark results in test mode (#56435)
Summary: Pull Request resolved: #56435 Avoid printing the result summary table when benchmarks are executed in test mode. In test mode, benchmarks run only a single iteration with no warmup, so the timing results are not meaningful for comparison. The per-suite results table (console.table) was already skipped in test mode, but the benchmark result was still reported to the runner, which could cause the cross-variant comparison table to be printed with meaningless data. This change skips the reportBenchmarkResult call entirely when running in test mode. Changelog: [Internal] Reviewed By: lenaic Differential Revision: D100795458 fbshipit-source-id: 910f0aa5615ea07fd19b3703a2774e13b4531743
1 parent 7ac759d commit c482b93

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

private/react-native-fantom/src/Benchmark.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,9 @@ export function suite(
215215
'Failing focused test to prevent it from being committed',
216216
);
217217
}
218-
reportBenchmarkResult(createBenchmarkResultsObject(bench, tasks));
218+
if (!isTestOnly) {
219+
reportBenchmarkResult(createBenchmarkResultsObject(bench, tasks));
220+
}
219221
});
220222

221223
const test = (name: string, fn: SyncFn, options?: FnOptions): SuiteAPI => {

0 commit comments

Comments
 (0)