Skip to content

Commit 49bbe51

Browse files
committed
We've decided we're only going to keep one BigInt test for now.
bigint-noble-ed25519 is the remaining BigInt test enabled by default as it appears to do the most interesting things with BigInts. The rest are now disabled by default. They will run if they're passed via a test list but are otherwise not enabled. To make this work there's a new property on `Benchmark`s/`plan`s that disables them by default.
1 parent 901c95b commit 49bbe51

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

JetStreamDriver.js

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ class Benchmark {
578578
this.scripts = null;
579579

580580
this._resourcesPromise = null;
581+
this.disabledByDefault = Boolean(plan.disabledByDefault);
581582
}
582583

583584
get name() { return this.plan.name; }
@@ -1828,6 +1829,7 @@ const BENCHMARKS = [
18281829
worstCaseCount: 1,
18291830
deterministicRandom: true,
18301831
testGroup: BigIntNobleGroup,
1832+
disabledByDefault: true,
18311833
}),
18321834
new AsyncBenchmark({
18331835
name: "bigint-noble-secp256k1",
@@ -1838,6 +1840,7 @@ const BENCHMARKS = [
18381840
],
18391841
deterministicRandom: true,
18401842
testGroup: BigIntNobleGroup,
1843+
disabledByDefault: true,
18411844
}),
18421845
new AsyncBenchmark({
18431846
name: "bigint-noble-ed25519",
@@ -1861,6 +1864,7 @@ const BENCHMARKS = [
18611864
worstCaseCount: 2,
18621865
deterministicRandom: true,
18631866
testGroup: BigIntMiscGroup,
1867+
disabledByDefault: true,
18641868
}),
18651869
new DefaultBenchmark({
18661870
name: "bigint-bigdenary",
@@ -1871,6 +1875,7 @@ const BENCHMARKS = [
18711875
iterations: 160,
18721876
worstCaseCount: 16,
18731877
testGroup: BigIntMiscGroup,
1878+
disabledByDefault: true,
18741879
}),
18751880
// Proxy
18761881
new AsyncBenchmark({
@@ -2258,25 +2263,28 @@ for (const benchmark of BENCHMARKS) {
22582263

22592264
this.JetStream = new Driver();
22602265

2261-
function enableBenchmarksByName(testName)
2266+
function enableBenchmarksByName(testName, forceEnable)
22622267
{
22632268
const benchmark = benchmarksByName.get(testName);
22642269

2265-
if (benchmark)
2266-
JetStream.addBenchmark(benchmark);
2267-
else
2270+
if (!benchmark)
22682271
throw "Couldn't find test named \"" + testName + "\"";
2272+
2273+
if (!forceEnable && benchmark.disabledByDefault)
2274+
return;
2275+
2276+
JetStream.addBenchmark(benchmark);
22692277
}
22702278

2271-
function enableBenchmarksByGroup(groupSymbol)
2279+
function enableBenchmarksByGroup(groupSymbol, forceEnable = false)
22722280
{
22732281
const benchmarkNames = benchmarksByGroup.get(groupSymbol);
22742282

22752283
if (!benchmarkNames)
22762284
throw "Couldn't find test group named: \"" + Symbol.keyFor(groupSymbol) + "\"";
22772285

22782286
for (let name of benchmarkNames)
2279-
enableBenchmarksByName(name);
2287+
enableBenchmarksByName(name, forceEnable);
22802288
}
22812289

22822290
function processTestList(testList)
@@ -2288,12 +2296,13 @@ function processTestList(testList)
22882296
else
22892297
benchmarkNames = testList.split(/[\s,]/);
22902298

2299+
const forceEnable = true;
22912300
for (const name of benchmarkNames) {
22922301
const groupSymbol = Symbol.for(name);
22932302
if (benchmarksByGroup.has(groupSymbol))
2294-
enableBenchmarksByGroup(groupSymbol)
2303+
enableBenchmarksByGroup(groupSymbol, forceEnable)
22952304
else
2296-
enableBenchmarksByName(name);
2305+
enableBenchmarksByName(name, forceEnable);
22972306
}
22982307
}
22992308

0 commit comments

Comments
 (0)