File tree Expand file tree Collapse file tree 2 files changed +461
-321
lines changed
packages/d2ts-benchmark/src Expand file tree Collapse file tree 2 files changed +461
-321
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export class Suite {
4949 const result : RunResult = {
5050 startupTime : 0 ,
5151 firstRunTime : 0 ,
52- incrementalTimes : [ ] ,
52+ incrementalTimes : new Array ( this . incrementalRuns ) . fill ( 0 ) ,
5353 teardownTime : 0 ,
5454 }
5555
@@ -65,11 +65,13 @@ export class Suite {
6565 for ( let i = 0 ; i < this . incrementalRuns ; i ++ ) {
6666 start = performance . now ( )
6767 benchmark . incrementalRun ( ctx , i )
68- result . incrementalTimes . push ( performance . now ( ) - start )
68+ result . incrementalTimes [ i ] = performance . now ( ) - start
6969 if (
7070 this . maxTimeDoingIncrementalRuns &&
7171 performance . now ( ) - startedAt > this . maxTimeDoingIncrementalRuns
7272 ) {
73+ // truncate the array to the current index
74+ result . incrementalTimes = result . incrementalTimes . slice ( 0 , i )
7375 break
7476 }
7577 }
You can’t perform that action at this time.
0 commit comments