File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
.github/scripts/analyze_benchmarks Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 1
1
import { readFile } from 'fs/promises' ;
2
2
3
3
export type BenchmarkEntry = {
4
- instructions : { __bigint__ : string } ;
4
+ instructions : string ;
5
5
method_name : string ;
6
- timestamp : { __bigint__ : string } ;
6
+ timestamp : string ;
7
7
} ;
8
8
9
9
type VersionBenchmarks = {
Original file line number Diff line number Diff line change @@ -23,11 +23,13 @@ const BASELINE_EFFICIENCY_WEIGHTS = {
23
23
* @returns Statistical analysis of the benchmark data
24
24
*/
25
25
export function calculateVersionStatistics (
26
- entries : BenchmarkEntry [ ]
26
+ entries : BenchmarkEntry [ ] | undefined
27
27
) : Statistics {
28
- const instructions = entries . map ( ( entry ) =>
29
- Number ( entry . instructions . __bigint__ )
30
- ) ;
28
+ if ( entries === undefined || entries . length === 0 ) {
29
+ throw new Error ( 'No benchmark entries found for this version' ) ;
30
+ }
31
+
32
+ const instructions = entries . map ( ( entry ) => Number ( entry . instructions ) ) ;
31
33
32
34
return calculateStatistics ( instructions ) ;
33
35
}
You can’t perform that action at this time.
0 commit comments