Skip to content

Commit 539ab94

Browse files
authored
Merge pull request #71 from kmiller68/disable-extra-bigint-tests
Disable all BigInt tests except bigint-noble-ed25519 by default 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 Benchmarks/plans that disables them by default.
2 parents 1d10eb0 + ff88901 commit 539ab94

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

JetStreamDriver.js

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ class Benchmark {
631631
this.tags = new Set(plan.tags);
632632
this.iterations = getIterationCount(plan);
633633
this.isAsync = !!plan.isAsync;
634+
this.disabledByDefault = !!plan.disabledByDefault;
634635
this.scripts = null;
635636
this._resourcesPromise = null;
636637
this._state = BenchmarkState.READY;
@@ -1891,6 +1892,7 @@ let BENCHMARKS = [
18911892
worstCaseCount: 1,
18921893
deterministicRandom: true,
18931894
tags: ["BigIntNoble"],
1895+
disabledByDefault: true,
18941896
}),
18951897
new AsyncBenchmark({
18961898
name: "bigint-noble-secp256k1",
@@ -1901,6 +1903,7 @@ let BENCHMARKS = [
19011903
],
19021904
deterministicRandom: true,
19031905
tags: ["BigIntNoble"],
1906+
disabledByDefault: true,
19041907
}),
19051908
new AsyncBenchmark({
19061909
name: "bigint-noble-ed25519",
@@ -1924,6 +1927,7 @@ let BENCHMARKS = [
19241927
worstCaseCount: 2,
19251928
deterministicRandom: true,
19261929
tags: ["BigIntMisc"],
1930+
disabledByDefault: true,
19271931
}),
19281932
new DefaultBenchmark({
19291933
name: "bigint-bigdenary",
@@ -1934,6 +1938,7 @@ let BENCHMARKS = [
19341938
iterations: 160,
19351939
worstCaseCount: 16,
19361940
tags: ["BigIntMisc"],
1941+
disabledByDefault: true,
19371942
}),
19381943
// Proxy
19391944
new AsyncBenchmark({
@@ -2321,17 +2326,28 @@ for (const benchmark of BENCHMARKS) {
23212326

23222327
this.JetStream = new Driver();
23232328

2329+
function enableBenchmarks(benchmarks, forceEnable = false)
2330+
{
2331+
for (let benchmark of benchmarks) {
2332+
if (!forceEnable && benchmark.disabledByDefault)
2333+
return;
2334+
2335+
JetStream.addBenchmark(benchmark);
2336+
}
2337+
}
2338+
23242339
function enableBenchmarksByName(name)
23252340
{
23262341
const benchmark = benchmarksByName.get(name);
23272342

2328-
if (benchmark)
2329-
JetStream.addBenchmark(benchmark);
2330-
else
2343+
if (!benchmark)
23312344
throw new Error(`Couldn't find benchmark named "${name}"`);
2345+
2346+
// We only use this for test lists.
2347+
JetStream.addBenchmark(benchmark);
23322348
}
23332349

2334-
function enableBenchmarksByTag(tag)
2350+
function enableBenchmarksByTag(tag, forceEnable = false)
23352351
{
23362352
const benchmarks = benchmarksByTag.get(tag);
23372353

@@ -2340,8 +2356,12 @@ function enableBenchmarksByTag(tag)
23402356
throw new Error(`Couldn't find tag named: ${tag}.\n Choices are ${validTags}`);
23412357
}
23422358

2343-
for (let benchmark of benchmarks)
2359+
for (const benchmark of benchmarks) {
2360+
if (!forceEnable && benchmark.disabledByDefault)
2361+
continue;
2362+
23442363
JetStream.addBenchmark(benchmark);
2364+
}
23452365
}
23462366

23472367
function processTestList(testList)
@@ -2353,9 +2373,10 @@ function processTestList(testList)
23532373
else
23542374
benchmarkNames = testList.split(/[\s,]/);
23552375

2376+
const forceEnable = true;
23562377
for (const name of benchmarkNames) {
23572378
if (benchmarksByTag.has(name))
2358-
enableBenchmarksByTag(name);
2379+
enableBenchmarksByTag(name, forceEnable);
23592380
else
23602381
enableBenchmarksByName(name);
23612382
}

0 commit comments

Comments
 (0)