Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 27 additions & 6 deletions JetStreamDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ class Benchmark {
this.tags = new Set(plan.tags);
this.iterations = getIterationCount(plan);
this.isAsync = !!plan.isAsync;
this.disabledByDefault = !!plan.disabledByDefault;
this.scripts = null;
this._resourcesPromise = null;
this._state = BenchmarkState.READY;
Expand Down Expand Up @@ -1879,6 +1880,7 @@ let BENCHMARKS = [
worstCaseCount: 1,
deterministicRandom: true,
tags: ["BigIntNoble"],
disabledByDefault: true,
}),
new AsyncBenchmark({
name: "bigint-noble-secp256k1",
Expand All @@ -1889,6 +1891,7 @@ let BENCHMARKS = [
],
deterministicRandom: true,
tags: ["BigIntNoble"],
disabledByDefault: true,
}),
new AsyncBenchmark({
name: "bigint-noble-ed25519",
Expand All @@ -1912,6 +1915,7 @@ let BENCHMARKS = [
worstCaseCount: 2,
deterministicRandom: true,
tags: ["BigIntMisc"],
disabledByDefault: true,
}),
new DefaultBenchmark({
name: "bigint-bigdenary",
Expand All @@ -1922,6 +1926,7 @@ let BENCHMARKS = [
iterations: 160,
worstCaseCount: 16,
tags: ["BigIntMisc"],
disabledByDefault: true,
}),
// Proxy
new AsyncBenchmark({
Expand Down Expand Up @@ -2309,17 +2314,28 @@ for (const benchmark of BENCHMARKS) {

this.JetStream = new Driver();

function enableBenchmarks(benchmarks, forceEnable = false)
{
for (let benchmark of benchmarks) {
if (!forceEnable && benchmark.disabledByDefault)
return;

JetStream.addBenchmark(benchmark);
}
}

function enableBenchmarksByName(name)
{
const benchmark = benchmarksByName.get(name);

if (benchmark)
JetStream.addBenchmark(benchmark);
else
if (!benchmark)
throw new Error(`Couldn't find benchmark named "${name}"`);

// We only use this for test lists.
JetStream.addBenchmark(benchmark);
}

function enableBenchmarksByTag(tag)
function enableBenchmarksByTag(tag, forceEnable = false)
{
const benchmarks = benchmarksByTag.get(tag);

Expand All @@ -2328,8 +2344,12 @@ function enableBenchmarksByTag(tag)
throw new Error(`Couldn't find tag named: ${tag}.\n Choices are ${validTags}`);
}

for (let benchmark of benchmarks)
for (const benchmark of benchmarks) {
if (!forceEnable && benchmark.disabledByDefault)
continue;

JetStream.addBenchmark(benchmark);
}
}

function processTestList(testList)
Expand All @@ -2341,9 +2361,10 @@ function processTestList(testList)
else
benchmarkNames = testList.split(/[\s,]/);

const forceEnable = true;
for (const name of benchmarkNames) {
if (benchmarksByTag.has(name))
enableBenchmarksByTag(name);
enableBenchmarksByTag(name, forceEnable);
else
enableBenchmarksByName(name);
}
Expand Down
Loading