@@ -262,7 +262,7 @@ class Driver {
262
262
263
263
if ( isInBrowser && globalThis . prefetchResources ) {
264
264
const cache = JetStream . blobDataCache ;
265
- for ( const file of benchmark . plan . files ) {
265
+ for ( const file of benchmark . files ) {
266
266
const blobData = cache [ file ] ;
267
267
blobData . refCount -- ;
268
268
if ( ! blobData . refCount )
@@ -709,6 +709,7 @@ class Benchmark {
709
709
}
710
710
711
711
get name ( ) { return this . plan . name ; }
712
+ get files ( ) { return this . plan . files ; }
712
713
713
714
get isDone ( ) {
714
715
return this . _state == BenchmarkState . DONE || this . _state == BenchmarkState . ERROR ;
@@ -1148,17 +1149,37 @@ class GroupedBenchmark extends Benchmark {
1148
1149
benchmark . prefetchResourcesForShell ( ) ;
1149
1150
}
1150
1151
1152
+ get files ( ) {
1153
+ let files = [ ] ;
1154
+ for ( const benchmark of this . benchmarks )
1155
+ files = files . concat ( benchmark . files ) ;
1156
+ return files ;
1157
+ }
1158
+
1151
1159
async run ( ) {
1160
+ this . _state = BenchmarkState . PREPARE ;
1152
1161
performance . mark ( this . name ) ;
1153
1162
this . startTime = performance . now ( ) ;
1154
1163
1155
- for ( const benchmark of this . benchmarks )
1156
- await benchmark . run ( ) ;
1164
+ let benchmark ;
1165
+ try {
1166
+ this . _state = BenchmarkState . RUNNING ;
1167
+ for ( benchmark of this . benchmarks )
1168
+ await benchmark . run ( ) ;
1169
+ } catch ( e ) {
1170
+ this . _state = BenchmarkState . ERROR ;
1171
+ console . log ( `Error in runCode of grouped benchmark ${ benchmark . name } : ` , e ) ;
1172
+ console . log ( e . stack ) ;
1173
+ throw e ;
1174
+ } finally {
1175
+ this . _state = BenchmarkState . FINALIZE ;
1176
+ }
1157
1177
1158
1178
this . endTime = performance . now ( ) ;
1159
1179
performance . measure ( this . name , this . name ) ;
1160
1180
1161
1181
this . processResults ( ) ;
1182
+ this . _state = BenchmarkState . DONE ;
1162
1183
}
1163
1184
1164
1185
processResults ( ) {
0 commit comments