@@ -94,10 +94,17 @@ export function findIssue(issueNumber: number): Issue | undefined {
94
94
export enum BenchmarkType {
95
95
CPU ,
96
96
MEM ,
97
- DUMMY ,
98
- STARTUP ,
97
+ STARTUP = 3 ,
98
+ SIZE = 5 ,
99
99
}
100
100
101
+ const benchmarkTypes = [
102
+ BenchmarkType . CPU ,
103
+ BenchmarkType . MEM ,
104
+ BenchmarkType . STARTUP ,
105
+ BenchmarkType . SIZE ,
106
+ ] ;
107
+
101
108
export interface Benchmark {
102
109
id : string ;
103
110
type : BenchmarkType ;
@@ -133,10 +140,12 @@ interface ResultData {
133
140
export const SORT_BY_NAME = "SORT_BY_NAME" ;
134
141
export const SORT_BY_GEOMMEAN_CPU = "SORT_BY_GEOMMEAN_CPU" ;
135
142
export const SORT_BY_GEOMMEAN_MEM = "SORT_BY_GEOMMEAN_MEM" ;
143
+ export const SORT_BY_GEOMMEAN_SIZE = "SORT_BY_GEOMMEAN_SIZE" ;
136
144
export const SORT_BY_GEOMMEAN_STARTUP = "SORT_BY_GEOMMEAN_STARTUP" ;
137
145
export type T_SORT_BY_GEOMMEAN =
138
146
| typeof SORT_BY_GEOMMEAN_CPU
139
147
| typeof SORT_BY_GEOMMEAN_MEM
148
+ | typeof SORT_BY_GEOMMEAN_SIZE
140
149
| typeof SORT_BY_GEOMMEAN_STARTUP ;
141
150
142
151
const computeColor = function ( factor : number ) : string {
@@ -270,21 +279,9 @@ const formatEn = new Intl.NumberFormat("en-US", {
270
279
271
280
export class ResultTableData {
272
281
resultsMap = new Map < BenchmarkType , ResultData > ( ) ;
273
- // // Rows
274
- // benchmarksCPU: Array<Benchmark>;
275
- // benchmarksStartup: Array<Benchmark>;
276
- // benchmarksMEM: Array<Benchmark>;
277
- // Columns
278
282
frameworks : Array < Framework > ;
279
283
frameworksForFactors : Array < Framework > ;
280
284
selectedFameworks : Set < Framework > ;
281
- // Cell data
282
- // resultsCPU: Array<Array<TableResultValueEntry|null>>; // [benchmark][framework]
283
- // geomMeanCPU: Array<TableResultGeommeanEntry|null>;
284
- // geomMeanStartup: Array<TableResultGeommeanEntry|null>;
285
- // geomMeanMEM: Array<TableResultGeommeanEntry|null>;
286
- // resultsStartup: Array<Array<TableResultValueEntry|null>>;
287
- // resultsMEM: Array<Array<TableResultValueEntry|null>>;
288
285
289
286
constructor (
290
287
public allFrameworks : Array < Framework > ,
@@ -378,11 +375,6 @@ export class ResultTableData {
378
375
return { benchmarks, results, geomMean, comparison } ;
379
376
} ;
380
377
381
- const benchmarkTypes = [
382
- BenchmarkType . CPU ,
383
- BenchmarkType . MEM ,
384
- BenchmarkType . STARTUP ,
385
- ] ;
386
378
for ( const type of benchmarkTypes ) {
387
379
this . resultsMap . set ( type , createResult ( type ) ) ;
388
380
}
@@ -405,6 +397,10 @@ export class ResultTableData {
405
397
sortValue =
406
398
this . getResult ( BenchmarkType . MEM ) . geomMean [ frameworkIndex ] ! . mean ||
407
399
Number . POSITIVE_INFINITY ;
400
+ else if ( sortKey === SORT_BY_GEOMMEAN_SIZE )
401
+ sortValue =
402
+ this . getResult ( BenchmarkType . SIZE ) . geomMean [ frameworkIndex ] ! . mean ||
403
+ Number . POSITIVE_INFINITY ;
408
404
else if ( sortKey === SORT_BY_GEOMMEAN_STARTUP )
409
405
sortValue =
410
406
this . getResult ( BenchmarkType . STARTUP ) . geomMean [ frameworkIndex ] !
@@ -416,6 +412,9 @@ export class ResultTableData {
416
412
const memIdx = this . getResult ( BenchmarkType . MEM ) . benchmarks . findIndex (
417
413
( b ) => b . id === sortKey ,
418
414
) ;
415
+ const sizeIdx = this . getResult ( BenchmarkType . SIZE ) . benchmarks . findIndex (
416
+ ( b ) => b . id === sortKey ,
417
+ ) ;
419
418
const startupIdx = this . getResult (
420
419
BenchmarkType . STARTUP ,
421
420
) . benchmarks . findIndex ( ( b ) => b . id === sortKey ) ;
@@ -432,6 +431,10 @@ export class ResultTableData {
432
431
sortValue =
433
432
this . getResult ( BenchmarkType . MEM ) . results [ memIdx ] [ frameworkIndex ]
434
433
?. value ?? Number . POSITIVE_INFINITY ;
434
+ else if ( sizeIdx > - 1 )
435
+ sortValue =
436
+ this . getResult ( BenchmarkType . SIZE ) . results [ sizeIdx ] [ frameworkIndex ]
437
+ ?. value ?? Number . POSITIVE_INFINITY ;
435
438
else throw Error ( `sortKey ${ sortKey } not found` ) ;
436
439
}
437
440
return {
@@ -447,12 +450,6 @@ export class ResultTableData {
447
450
448
451
this . frameworks = this . remap ( remappedIdx , this . frameworks ) ;
449
452
450
- const benchmarkTypes = [
451
- BenchmarkType . CPU ,
452
- BenchmarkType . MEM ,
453
- BenchmarkType . STARTUP ,
454
- ] ;
455
-
456
453
for ( const type of benchmarkTypes ) {
457
454
const result = this . getResult ( type ) ;
458
455
@@ -588,9 +585,9 @@ export class ResultTableData {
588
585
( 1.959964 * ( resultValues . standardDeviation || 0 ) ) /
589
586
Math . sqrt ( resultValues . values . length ) ;
590
587
const conficenceIntervalStr =
591
- benchmark . type === BenchmarkType . MEM
592
- ? null
593
- : conficenceInterval . toFixed ( 1 ) ;
588
+ benchmark . type === BenchmarkType . CPU
589
+ ? conficenceInterval . toFixed ( 1 )
590
+ : null ;
594
591
const formattedValue = formatEn . format ( value ) ;
595
592
596
593
if ( ! this . compareWith ) {
0 commit comments