File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,13 +62,23 @@ function runBenchmark(
6262
6363 const results : Array < BenchmarkResult > = [ ] ;
6464 for ( let i = 0 ; i < benchmarkProjects . length ; ++ i ) {
65- results . push (
66- computeStats (
65+ let result : BenchmarkResult ;
66+ try {
67+ result = computeStats (
6768 benchmarkProjects [ i ] . revision ,
6869 timingSamples [ i ] ,
6970 memorySamples [ i ] ,
70- ) ,
71- ) ;
71+ ) ;
72+ } catch ( error ) {
73+ const errorMessage =
74+ error instanceof Error ? error . message : String ( error ) ;
75+ console . log (
76+ ' ' + benchmarkProjects [ i ] . revision + ': ' + red ( errorMessage ) ,
77+ ) ;
78+ return ;
79+ }
80+
81+ results . push ( result ) ;
7282 }
7383
7484 console . log ( '\n' ) ;
Original file line number Diff line number Diff line change @@ -21,9 +21,6 @@ export function computeStats(
2121 timingSamples : ReadonlyArray < number > ,
2222 memorySamples : ReadonlyArray < number > ,
2323) : BenchmarkResult {
24- assert ( timingSamples . length > 1 ) ;
25- assert ( memorySamples . length > 0 ) ;
26-
2724 const { mean, marginOfError } = computeMeanStats ( timingSamples ) ;
2825
2926 let meanMemUsed = 0 ;
You can’t perform that action at this time.
0 commit comments