Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions resources/benchmark/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,23 @@ function runBenchmark(

const results: Array<BenchmarkResult> = [];
for (let i = 0; i < benchmarkProjects.length; ++i) {
results.push(
computeStats(
let result: BenchmarkResult;
try {
result = computeStats(
benchmarkProjects[i].revision,
timingSamples[i],
memorySamples[i],
),
);
);
} catch (error) {
const errorMessage =
error instanceof Error ? error.message : String(error);
console.log(
' ' + benchmarkProjects[i].revision + ': ' + red(errorMessage),
);
return;
}

results.push(result);
}

console.log('\n');
Expand Down
3 changes: 0 additions & 3 deletions resources/benchmark/statistics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export function computeStats(
timingSamples: ReadonlyArray<number>,
memorySamples: ReadonlyArray<number>,
): BenchmarkResult {
assert(timingSamples.length > 1);
assert(memorySamples.length > 0);

const { mean, marginOfError } = computeMeanStats(timingSamples);

let meanMemUsed = 0;
Expand Down
Loading