@@ -631,6 +631,7 @@ class Benchmark {
631
631
this . tags = new Set ( plan . tags ) ;
632
632
this . iterations = getIterationCount ( plan ) ;
633
633
this . isAsync = ! ! plan . isAsync ;
634
+ this . disabledByDefault = ! ! plan . disabledByDefault ;
634
635
this . scripts = null ;
635
636
this . _resourcesPromise = null ;
636
637
this . _state = BenchmarkState . READY ;
@@ -1879,6 +1880,7 @@ let BENCHMARKS = [
1879
1880
worstCaseCount : 1 ,
1880
1881
deterministicRandom : true ,
1881
1882
tags : [ "BigIntNoble" ] ,
1883
+ disabledByDefault : true ,
1882
1884
} ) ,
1883
1885
new AsyncBenchmark ( {
1884
1886
name : "bigint-noble-secp256k1" ,
@@ -1889,6 +1891,7 @@ let BENCHMARKS = [
1889
1891
] ,
1890
1892
deterministicRandom : true ,
1891
1893
tags : [ "BigIntNoble" ] ,
1894
+ disabledByDefault : true ,
1892
1895
} ) ,
1893
1896
new AsyncBenchmark ( {
1894
1897
name : "bigint-noble-ed25519" ,
@@ -1912,6 +1915,7 @@ let BENCHMARKS = [
1912
1915
worstCaseCount : 2 ,
1913
1916
deterministicRandom : true ,
1914
1917
tags : [ "BigIntMisc" ] ,
1918
+ disabledByDefault : true ,
1915
1919
} ) ,
1916
1920
new DefaultBenchmark ( {
1917
1921
name : "bigint-bigdenary" ,
@@ -1922,6 +1926,7 @@ let BENCHMARKS = [
1922
1926
iterations : 160 ,
1923
1927
worstCaseCount : 16 ,
1924
1928
tags : [ "BigIntMisc" ] ,
1929
+ disabledByDefault : true ,
1925
1930
} ) ,
1926
1931
// Proxy
1927
1932
new AsyncBenchmark ( {
@@ -2309,17 +2314,28 @@ for (const benchmark of BENCHMARKS) {
2309
2314
2310
2315
this . JetStream = new Driver ( ) ;
2311
2316
2317
+ function enableBenchmarks ( benchmarks , forceEnable = false )
2318
+ {
2319
+ for ( let benchmark of benchmarks ) {
2320
+ if ( ! forceEnable && benchmark . disabledByDefault )
2321
+ return ;
2322
+
2323
+ JetStream . addBenchmark ( benchmark ) ;
2324
+ }
2325
+ }
2326
+
2312
2327
function enableBenchmarksByName ( name )
2313
2328
{
2314
2329
const benchmark = benchmarksByName . get ( name ) ;
2315
2330
2316
- if ( benchmark )
2317
- JetStream . addBenchmark ( benchmark ) ;
2318
- else
2331
+ if ( ! benchmark )
2319
2332
throw new Error ( `Couldn't find benchmark named "${ name } "` ) ;
2333
+
2334
+ // We only use this for test lists.
2335
+ JetStream . addBenchmark ( benchmark ) ;
2320
2336
}
2321
2337
2322
- function enableBenchmarksByTag ( tag )
2338
+ function enableBenchmarksByTag ( tag , forceEnable = false )
2323
2339
{
2324
2340
const benchmarks = benchmarksByTag . get ( tag ) ;
2325
2341
@@ -2328,8 +2344,12 @@ function enableBenchmarksByTag(tag)
2328
2344
throw new Error ( `Couldn't find tag named: ${ tag } .\n Choices are ${ validTags } ` ) ;
2329
2345
}
2330
2346
2331
- for ( let benchmark of benchmarks )
2347
+ for ( const benchmark of benchmarks ) {
2348
+ if ( ! forceEnable && benchmark . disabledByDefault )
2349
+ continue ;
2350
+
2332
2351
JetStream . addBenchmark ( benchmark ) ;
2352
+ }
2333
2353
}
2334
2354
2335
2355
function processTestList ( testList )
@@ -2341,9 +2361,10 @@ function processTestList(testList)
2341
2361
else
2342
2362
benchmarkNames = testList . split ( / [ \s , ] / ) ;
2343
2363
2364
+ const forceEnable = true ;
2344
2365
for ( const name of benchmarkNames ) {
2345
2366
if ( benchmarksByTag . has ( name ) )
2346
- enableBenchmarksByTag ( name ) ;
2367
+ enableBenchmarksByTag ( name , forceEnable ) ;
2347
2368
else
2348
2369
enableBenchmarksByName ( name ) ;
2349
2370
}
0 commit comments