From 49a85fefcbdcd9b0266a71bd5cd0e3b37b9981f3 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Tue, 26 Nov 2024 14:57:36 +0100 Subject: [PATCH 1/6] improvements --- JetStreamDriver.js | 267 +++++++++++++++++++++++---------------------- index.html | 1 + 2 files changed, 139 insertions(+), 129 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index d384ee1..3a9f7ed 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -525,16 +525,23 @@ class Benchmark { constructor(plan) { this.plan = plan; - this.testGroup = plan.testGroup; - + this.tags = this._validateTags(plan.tags); this.iterations = getIterationCount(plan); this.isAsync = !!plan.isAsync; - this.scripts = null; - this._resourcesPromise = null; } + _validateTags(tags) { + const validated = new Set(); + for (const tag of tags) { + if (!TAGS.has(tag)) + throw new Error(`Invalid benchmark tag "${tag}"`); + validated.add(tag); + } + return validated; + } + get name() { return this.plan.name; } get runnerCode() { @@ -691,7 +698,7 @@ class Benchmark { async doLoadBlob(resource) { let response; - const tries = 3; + let tries = 3; while (tries--) { let hasError = false; try { @@ -1244,25 +1251,26 @@ class WasmBenchmark extends Benchmark { } }; -const ARESGroup = Symbol.for("ARES"); -const CDJSGroup = Symbol.for("CDJS"); -const CodeLoadGroup = Symbol.for("CodeLoad"); -const LuaJSFightGroup = Symbol.for("LuaJSFight"); -const OctaneGroup = Symbol.for("Octane"); -const RexBenchGroup = Symbol.for("RexBench"); -const SeaMonsterGroup = Symbol.for("SeaMonster"); -const SimpleGroup = Symbol.for("Simple"); -const SunSpiderGroup = Symbol.for("SunSpider"); -const BigIntNobleGroup = Symbol.for("BigIntNoble"); -const BigIntMiscGroup = Symbol.for("BigIntMisc"); -const ProxyGroup = Symbol.for("ProxyGroup"); -const ClassFieldsGroup = Symbol.for("ClassFieldsGroup"); -const GeneratorsGroup = Symbol.for("GeneratorsGroup"); -const WasmGroup = Symbol.for("Wasm"); -const WorkerTestsGroup = Symbol.for("WorkerTests"); -const WSLGroup = Symbol.for("WSL"); -const WTBGroup = Symbol.for("WTB"); - +const TAGS = new Set([ +"ARES", +"CDJS", +"CodeLoad", +"LuaJSFight", +"Octane", +"RexBench", +"SeaMonster", +"Simple", +"SunSpider", +"BigIntNoble", +"BigIntMisc", +"Proxy", +"ClassFields", +"Generators", +"Wasm", +"WorkerTests", +"WSL", +"WTB" +]); let BENCHMARKS = [ // ARES @@ -1291,7 +1299,7 @@ let BENCHMARKS = [ , "./ARES-6/Air/payload-typescript-scanIdentifier.js" , "./ARES-6/Air/benchmark.js" ], - testGroup: ARESGroup + tags: ["ARES"] }), new DefaultBenchmark({ name: "Basic", @@ -1307,7 +1315,7 @@ let BENCHMARKS = [ , "./ARES-6/Basic/util.js" , "./ARES-6/Basic/benchmark.js" ], - testGroup: ARESGroup + tags: ["ARES"] }), new DefaultBenchmark({ name: "ML", @@ -1316,7 +1324,7 @@ let BENCHMARKS = [ , "./ARES-6/ml/benchmark.js" ], iterations: 60, - testGroup: ARESGroup + tags: ["ARES"] }), new DefaultBenchmark({ name: "Babylon", @@ -1330,7 +1338,7 @@ let BENCHMARKS = [ inspectorBlob: "./ARES-6/Babylon/inspector-blob.js", babylonBlob: "./ARES-6/Babylon/babylon-blob.js" }, - testGroup: ARESGroup + tags: ["ARES"] }), // CDJS new DefaultBenchmark({ @@ -1351,7 +1359,7 @@ let BENCHMARKS = [ ], iterations: 60, worstCaseCount: 3, - testGroup: CDJSGroup + tags: ["CDJS"] }), // CodeLoad new DefaultBenchmark({ @@ -1362,7 +1370,7 @@ let BENCHMARKS = [ preload: { inspectorPayloadBlob: "./code-load/inspector-payload-minified.js" }, - testGroup: CodeLoadGroup + tags: ["CodeLoad"] }), new DefaultBenchmark({ name: "multi-inspector-code-load", @@ -1372,7 +1380,7 @@ let BENCHMARKS = [ preload: { inspectorPayloadBlob: "./code-load/inspector-payload-minified.js" }, - testGroup: CodeLoadGroup + tags: ["CodeLoad"] }), // Octane new DefaultBenchmark({ @@ -1381,7 +1389,7 @@ let BENCHMARKS = [ "./Octane/box2d.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "octane-code-load", @@ -1389,7 +1397,7 @@ let BENCHMARKS = [ "./Octane/code-first-load.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "crypto", @@ -1397,7 +1405,7 @@ let BENCHMARKS = [ "./Octane/crypto.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "delta-blue", @@ -1405,7 +1413,7 @@ let BENCHMARKS = [ "./Octane/deltablue.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "earley-boyer", @@ -1413,7 +1421,7 @@ let BENCHMARKS = [ "./Octane/earley-boyer.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "gbemu", @@ -1422,7 +1430,7 @@ let BENCHMARKS = [ , "./Octane/gbemu-part2.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "mandreel", @@ -1431,7 +1439,7 @@ let BENCHMARKS = [ ], iterations: 80, deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "navier-stokes", @@ -1439,7 +1447,7 @@ let BENCHMARKS = [ "./Octane/navier-stokes.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "pdfjs", @@ -1447,14 +1455,14 @@ let BENCHMARKS = [ "./Octane/pdfjs.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "raytrace", files: [ "./Octane/raytrace.js" ], - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "regexp", @@ -1462,7 +1470,7 @@ let BENCHMARKS = [ "./Octane/regexp.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "richards", @@ -1470,7 +1478,7 @@ let BENCHMARKS = [ "./Octane/richards.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "splay", @@ -1478,7 +1486,7 @@ let BENCHMARKS = [ "./Octane/splay.js" ], deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "typescript", @@ -1490,7 +1498,7 @@ let BENCHMARKS = [ iterations: 15, worstCaseCount: 2, deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), new DefaultBenchmark({ name: "octane-zlib", @@ -1501,7 +1509,7 @@ let BENCHMARKS = [ iterations: 15, worstCaseCount: 2, deterministicRandom: true, - testGroup: OctaneGroup + tags: ["Octane"] }), // RexBench new DefaultBenchmark({ @@ -1513,7 +1521,7 @@ let BENCHMARKS = [ , "./RexBench/FlightPlanner/expectations.js" , "./RexBench/FlightPlanner/benchmark.js" ], - testGroup: RexBenchGroup + tags: ["RexBench"] }), new DefaultBenchmark({ name: "OfflineAssembler", @@ -1531,7 +1539,7 @@ let BENCHMARKS = [ , "./RexBench/OfflineAssembler/benchmark.js" ], iterations: 80, - testGroup: RexBenchGroup + tags: ["RexBench"] }), new DefaultBenchmark({ name: "UniPoker", @@ -1541,7 +1549,7 @@ let BENCHMARKS = [ , "./RexBench/UniPoker/benchmark.js" ], deterministicRandom: true, - testGroup: RexBenchGroup + tags: ["RexBench"] }), // Simple new DefaultBenchmark({ @@ -1551,28 +1559,28 @@ let BENCHMARKS = [ ], iterations: 15, worstCaseCount: 2, - testGroup: SimpleGroup + tags: ["Simple"] }), new DefaultBenchmark({ name: "hash-map", files: [ "./simple/hash-map.js" ], - testGroup: SimpleGroup + tags: ["Simple"] }), new AsyncBenchmark({ name: "doxbee-promise", files: [ "./simple/doxbee-promise.js", ], - testGroup: SimpleGroup, + tags: ["Simple",] }), new AsyncBenchmark({ name: "doxbee-async", files: [ "./simple/doxbee-async.js", ], - testGroup: SimpleGroup, + tags: ["Simple",] }), // SeaMonster new DefaultBenchmark({ @@ -1580,14 +1588,14 @@ let BENCHMARKS = [ files: [ "./SeaMonster/ai-astar.js" ], - testGroup: SeaMonsterGroup + tags: ["SeaMonster"] }), new DefaultBenchmark({ name: "gaussian-blur", files: [ "./SeaMonster/gaussian-blur.js" ], - testGroup: SeaMonsterGroup + tags: ["SeaMonster"] }), new DefaultBenchmark({ name: "stanford-crypto-aes", @@ -1595,7 +1603,7 @@ let BENCHMARKS = [ "./SeaMonster/sjlc.js" , "./SeaMonster/stanford-crypto-aes.js" ], - testGroup: SeaMonsterGroup + tags: ["SeaMonster"] }), new DefaultBenchmark({ name: "stanford-crypto-pbkdf2", @@ -1603,7 +1611,7 @@ let BENCHMARKS = [ "./SeaMonster/sjlc.js" , "./SeaMonster/stanford-crypto-pbkdf2.js" ], - testGroup: SeaMonsterGroup + tags: ["SeaMonster"] }), new DefaultBenchmark({ name: "stanford-crypto-sha256", @@ -1611,7 +1619,7 @@ let BENCHMARKS = [ "./SeaMonster/sjlc.js" , "./SeaMonster/stanford-crypto-sha256.js" ], - testGroup: SeaMonsterGroup + tags: ["SeaMonster"] }), new DefaultBenchmark({ name: "json-stringify-inspector", @@ -1621,7 +1629,7 @@ let BENCHMARKS = [ ], iterations: 20, worstCaseCount: 2, - testGroup: SeaMonsterGroup + tags: ["SeaMonster"] }), new DefaultBenchmark({ name: "json-parse-inspector", @@ -1631,7 +1639,7 @@ let BENCHMARKS = [ ], iterations: 20, worstCaseCount: 2, - testGroup: SeaMonsterGroup + tags: ["SeaMonster"] }), // BigInt new AsyncBenchmark({ @@ -1644,7 +1652,7 @@ let BENCHMARKS = [ iterations: 4, worstCaseCount: 1, deterministicRandom: true, - testGroup: BigIntNobleGroup, + tags: ["BigIntNoble",] }), new AsyncBenchmark({ name: "bigint-noble-secp256k1", @@ -1654,7 +1662,7 @@ let BENCHMARKS = [ "./bigint/noble-benchmark.js", ], deterministicRandom: true, - testGroup: BigIntNobleGroup, + tags: ["BigIntNoble",] }), new AsyncBenchmark({ name: "bigint-noble-ed25519", @@ -1665,7 +1673,7 @@ let BENCHMARKS = [ ], iterations: 30, deterministicRandom: true, - testGroup: BigIntNobleGroup, + tags: ["BigIntNoble",] }), new DefaultBenchmark({ name: "bigint-paillier", @@ -1677,7 +1685,7 @@ let BENCHMARKS = [ iterations: 10, worstCaseCount: 2, deterministicRandom: true, - testGroup: BigIntMiscGroup, + tags: ["BigIntMisc",] }), new DefaultBenchmark({ name: "bigint-bigdenary", @@ -1687,7 +1695,7 @@ let BENCHMARKS = [ ], iterations: 160, worstCaseCount: 16, - testGroup: BigIntMiscGroup, + tags: ["BigIntMisc",] }), // Proxy new AsyncBenchmark({ @@ -1700,7 +1708,7 @@ let BENCHMARKS = [ iterations: defaultIterationCount * 3, worstCaseCount: defaultWorstCaseCount * 3, benchmarkClass: AsyncBenchmark, - testGroup: ProxyGroup, + tags: ["Proxy",] }), new AsyncBenchmark({ name: "proxy-vue", @@ -1710,7 +1718,7 @@ let BENCHMARKS = [ "./proxy/vue-benchmark.js", ], benchmarkClass: AsyncBenchmark, - testGroup: ProxyGroup, + tags: ["Proxy",] }), // Class fields new DefaultBenchmark({ @@ -1718,14 +1726,14 @@ let BENCHMARKS = [ files: [ "./class-fields/raytrace-public-class-fields.js", ], - testGroup: ClassFieldsGroup, + tags: ["ClassFields",] }), new DefaultBenchmark({ name: "raytrace-private-class-fields", files: [ "./class-fields/raytrace-private-class-fields.js", ], - testGroup: ClassFieldsGroup, + tags: ["ClassFields",] }), // Generators new AsyncBenchmark({ @@ -1736,7 +1744,7 @@ let BENCHMARKS = [ iterations: 80, worstCaseCount: 6, deterministicRandom: true, - testGroup: GeneratorsGroup, + tags: ["Generators",] }), new DefaultBenchmark({ name: "sync-fs", @@ -1746,21 +1754,21 @@ let BENCHMARKS = [ iterations: 80, worstCaseCount: 6, deterministicRandom: true, - testGroup: GeneratorsGroup, + tags: ["Generators",] }), new DefaultBenchmark({ name: "lazy-collections", files: [ "./generators/lazy-collections.js", ], - testGroup: GeneratorsGroup, + tags: ["Generators",] }), new DefaultBenchmark({ name: "js-tokens", files: [ "./generators/js-tokens.js", ], - testGroup: GeneratorsGroup, + tags: ["Generators",] }), // Wasm new WasmBenchmark({ @@ -1771,7 +1779,7 @@ let BENCHMARKS = [ preload: { wasmBinary: "./wasm/HashSet.wasm" }, - testGroup: WasmGroup + tags: ["Wasm"] }), new WasmBenchmark({ name: "tsf-wasm", @@ -1781,7 +1789,7 @@ let BENCHMARKS = [ preload: { wasmBinary: "./wasm/tsf.wasm" }, - testGroup: WasmGroup + tags: ["Wasm"] }), new WasmBenchmark({ name: "quicksort-wasm", @@ -1791,7 +1799,7 @@ let BENCHMARKS = [ preload: { wasmBinary: "./wasm/quicksort.wasm" }, - testGroup: WasmGroup + tags: ["Wasm"] }), new WasmBenchmark({ name: "gcc-loops-wasm", @@ -1801,7 +1809,7 @@ let BENCHMARKS = [ preload: { wasmBinary: "./wasm/gcc-loops.wasm" }, - testGroup: WasmGroup + tags: ["Wasm"] }), new WasmBenchmark({ name: "richards-wasm", @@ -1811,7 +1819,7 @@ let BENCHMARKS = [ preload: { wasmBinary: "./wasm/richards.wasm" }, - testGroup: WasmGroup + tags: ["Wasm"] }), new WasmBenchmark({ name: "tfjs-wasm", @@ -1831,7 +1839,7 @@ let BENCHMARKS = [ }, async: true, deterministicRandom: true, - testGroup: WasmGroup + tags: ["Wasm"] }), new WasmBenchmark({ name: "tfjs-wasm-simd", @@ -1851,7 +1859,7 @@ let BENCHMARKS = [ }, async: true, deterministicRandom: true, - testGroup: WasmGroup + tags: ["Wasm"] }), new WasmBenchmark({ name: "argon2-wasm", @@ -1863,7 +1871,7 @@ let BENCHMARKS = [ preload: { argon2WasmBlob: "./wasm/argon2.wasm", }, - testGroup: WasmGroup + tags: ["Wasm"] }), new WasmBenchmark({ name: "argon2-wasm-simd", @@ -1875,7 +1883,7 @@ let BENCHMARKS = [ preload: { argon2WasmSimdBlob: "./wasm/argon2-simd.wasm", }, - testGroup: WasmGroup + tags: ["Wasm"] }), // WorkerTests new AsyncBenchmark({ @@ -1912,7 +1920,7 @@ let BENCHMARKS = [ , stringUnpackCode: "./worker/bomb-subtests/string-unpack-code.js" , regexpDNA: "./worker/bomb-subtests/regexp-dna.js" }, - testGroup: WorkerTestsGroup + tags: ["WorkerTests"] }), new AsyncBenchmark({ name: "segmentation", @@ -1924,13 +1932,13 @@ let BENCHMARKS = [ }, iterations: 36, worstCaseCount: 3, - testGroup: WorkerTestsGroup + tags: ["WorkerTests"] }), // WSL new WSLBenchmark({ name: "WSL", files: ["./WSL/Node.js" ,"./WSL/Type.js" ,"./WSL/ReferenceType.js" ,"./WSL/Value.js" ,"./WSL/Expression.js" ,"./WSL/Rewriter.js" ,"./WSL/Visitor.js" ,"./WSL/CreateLiteral.js" ,"./WSL/CreateLiteralType.js" ,"./WSL/PropertyAccessExpression.js" ,"./WSL/AddressSpace.js" ,"./WSL/AnonymousVariable.js" ,"./WSL/ArrayRefType.js" ,"./WSL/ArrayType.js" ,"./WSL/Assignment.js" ,"./WSL/AutoWrapper.js" ,"./WSL/Block.js" ,"./WSL/BoolLiteral.js" ,"./WSL/Break.js" ,"./WSL/CallExpression.js" ,"./WSL/CallFunction.js" ,"./WSL/Check.js" ,"./WSL/CheckLiteralTypes.js" ,"./WSL/CheckLoops.js" ,"./WSL/CheckRecursiveTypes.js" ,"./WSL/CheckRecursion.js" ,"./WSL/CheckReturns.js" ,"./WSL/CheckUnreachableCode.js" ,"./WSL/CheckWrapped.js" ,"./WSL/Checker.js" ,"./WSL/CloneProgram.js" ,"./WSL/CommaExpression.js" ,"./WSL/ConstexprFolder.js" ,"./WSL/ConstexprTypeParameter.js" ,"./WSL/Continue.js" ,"./WSL/ConvertPtrToArrayRefExpression.js" ,"./WSL/DereferenceExpression.js" ,"./WSL/DoWhileLoop.js" ,"./WSL/DotExpression.js" ,"./WSL/DoubleLiteral.js" ,"./WSL/DoubleLiteralType.js" ,"./WSL/EArrayRef.js" ,"./WSL/EBuffer.js" ,"./WSL/EBufferBuilder.js" ,"./WSL/EPtr.js" ,"./WSL/EnumLiteral.js" ,"./WSL/EnumMember.js" ,"./WSL/EnumType.js" ,"./WSL/EvaluationCommon.js" ,"./WSL/Evaluator.js" ,"./WSL/ExpressionFinder.js" ,"./WSL/ExternalOrigin.js" ,"./WSL/Field.js" ,"./WSL/FindHighZombies.js" ,"./WSL/FlattenProtocolExtends.js" ,"./WSL/FlattenedStructOffsetGatherer.js" ,"./WSL/FloatLiteral.js" ,"./WSL/FloatLiteralType.js" ,"./WSL/FoldConstexprs.js" ,"./WSL/ForLoop.js" ,"./WSL/Func.js" ,"./WSL/FuncDef.js" ,"./WSL/FuncInstantiator.js" ,"./WSL/FuncParameter.js" ,"./WSL/FunctionLikeBlock.js" ,"./WSL/HighZombieFinder.js" ,"./WSL/IdentityExpression.js" ,"./WSL/IfStatement.js" ,"./WSL/IndexExpression.js" ,"./WSL/InferTypesForCall.js" ,"./WSL/Inline.js" ,"./WSL/Inliner.js" ,"./WSL/InstantiateImmediates.js" ,"./WSL/IntLiteral.js" ,"./WSL/IntLiteralType.js" ,"./WSL/Intrinsics.js" ,"./WSL/LateChecker.js" ,"./WSL/Lexer.js" ,"./WSL/LexerToken.js" ,"./WSL/LiteralTypeChecker.js" ,"./WSL/LogicalExpression.js" ,"./WSL/LogicalNot.js" ,"./WSL/LoopChecker.js" ,"./WSL/MakeArrayRefExpression.js" ,"./WSL/MakePtrExpression.js" ,"./WSL/NameContext.js" ,"./WSL/NameFinder.js" ,"./WSL/NameResolver.js" ,"./WSL/NativeFunc.js" ,"./WSL/NativeFuncInstance.js" ,"./WSL/NativeType.js" ,"./WSL/NativeTypeInstance.js" ,"./WSL/NormalUsePropertyResolver.js" ,"./WSL/NullLiteral.js" ,"./WSL/NullType.js" ,"./WSL/OriginKind.js" ,"./WSL/OverloadResolutionFailure.js" ,"./WSL/Parse.js" ,"./WSL/Prepare.js" ,"./WSL/Program.js" ,"./WSL/ProgramWithUnnecessaryThingsRemoved.js" ,"./WSL/PropertyResolver.js" ,"./WSL/Protocol.js" ,"./WSL/ProtocolDecl.js" ,"./WSL/ProtocolFuncDecl.js" ,"./WSL/ProtocolRef.js" ,"./WSL/PtrType.js" ,"./WSL/ReadModifyWriteExpression.js" ,"./WSL/RecursionChecker.js" ,"./WSL/RecursiveTypeChecker.js" ,"./WSL/ResolveNames.js" ,"./WSL/ResolveOverloadImpl.js" ,"./WSL/ResolveProperties.js" ,"./WSL/ResolveTypeDefs.js" ,"./WSL/Return.js" ,"./WSL/ReturnChecker.js" ,"./WSL/ReturnException.js" ,"./WSL/StandardLibrary.js" ,"./WSL/StatementCloner.js" ,"./WSL/StructLayoutBuilder.js" ,"./WSL/StructType.js" ,"./WSL/Substitution.js" ,"./WSL/SwitchCase.js" ,"./WSL/SwitchStatement.js" ,"./WSL/SynthesizeEnumFunctions.js" ,"./WSL/SynthesizeStructAccessors.js" ,"./WSL/TrapStatement.js" ,"./WSL/TypeDef.js" ,"./WSL/TypeDefResolver.js" ,"./WSL/TypeOrVariableRef.js" ,"./WSL/TypeParameterRewriter.js" ,"./WSL/TypeRef.js" ,"./WSL/TypeVariable.js" ,"./WSL/TypeVariableTracker.js" ,"./WSL/TypedValue.js" ,"./WSL/UintLiteral.js" ,"./WSL/UintLiteralType.js" ,"./WSL/UnificationContext.js" ,"./WSL/UnreachableCodeChecker.js" ,"./WSL/VariableDecl.js" ,"./WSL/VariableRef.js" ,"./WSL/VisitingSet.js" ,"./WSL/WSyntaxError.js" ,"./WSL/WTrapError.js" ,"./WSL/WTypeError.js" ,"./WSL/WhileLoop.js" ,"./WSL/WrapChecker.js", "./WSL/Test.js"], - testGroup: WSLGroup + tags: ["WSL"] }), // 8bitbench new WasmBenchmark({ @@ -1945,7 +1953,7 @@ let BENCHMARKS = [ romBinary: "./8bitbench/assets/program.bin" }, async: true, - testGroup: WasmGroup + tags: ["Wasm"] }) ]; @@ -1962,7 +1970,7 @@ for (let test of luaJSFightTests) { files: [ `./LuaJSFight/${test}.js` ], - testGroup: LuaJSFightGroup + tags: ["LuaJSFight"] })); } @@ -1987,7 +1995,7 @@ for (let test of SUNSPIDER_TESTS) { files: [ `./SunSpider/${test}.js` ], - testGroup: SunSpiderGroup + tags: ["SunSpider"] })); } @@ -2012,48 +2020,50 @@ for (let name of WTB_TESTS) { ], iterations: 5, worstCaseCount: 1, - testGroup: WTBGroup + tags: ["WTB"] })); } -let benchmarksByName = new Map(); -let benchmarksByGroup = new Map(); +const benchmarksByName = new Map(); +const benchmarksByTag = new Map(); -for (let benchmark of BENCHMARKS) { - let testName = benchmark.name; +for (const benchmark of BENCHMARKS) { + const name = benchmark.name; - if (benchmarksByName.has(benchmark.name)) - throw "Duplicate test plan with name \"" + testName + "\""; + if (benchmarksByName.has(name)) + throw new Error(`Duplicate benchmark with name "${name}}"`); else - benchmarksByName.set(testName, benchmark); - - let group = benchmark.testGroup; + benchmarksByName.set(name, benchmark); - if (benchmarksByGroup.has(group)) - benchmarksByGroup.get(group).push(testName); - else - benchmarksByGroup.set(group, [testName]); + for (const tag of benchmark.tags) { + if (benchmarksByTag.has(tag)) + benchmarksByTag.get(tag).push(testName); + else + benchmarksByTag.set(tag, [testName]); + } } this.JetStream = new Driver(); -function enableBenchmarksByName(testName) +function enableBenchmarksByName(name) { - let benchmark = benchmarksByName.get(testName); + const benchmark = benchmarksByName.get(name); if (benchmark) JetStream.addBenchmark(benchmark); else - throw "Couldn't find test named \"" + testName + "\""; + throw new Error(`Couldn't find benchmark named "${name}"`); } -function enableBenchmarksByGroup(groupSymbol) +function enableBenchmarksByTag(tag) { - let benchmarkNames = benchmarksByGroup.get(groupSymbol); + let benchmarkNames = benchmarksByTag.get(tag); - if (!benchmarkNames) - throw "Couldn't find test group named: \"" + Symbol.keyFor(groupSymbol) + "\""; + if (!benchmarkNames) { + const validTags = Array.from(benchmarksByTag.keys()).join(", "); + throw new Error(`Couldn't find tag named: ${tag}.\n Choices are ${validTags}`); + } for (let name of benchmarkNames) enableBenchmarksByName(name); @@ -2069,9 +2079,8 @@ function processTestList(testList) benchmarkNames = testList.split(/[\s,]/); for (const name of benchmarkNames) { - const groupSymbol = Symbol.for(name); - if (benchmarksByGroup.has(groupSymbol)) - enableBenchmarksByGroup(groupSymbol) + if (benchmarksByTag.has(name)) + enableBenchmarksByTag(name); else enableBenchmarksByName(name); } @@ -2123,53 +2132,53 @@ if (typeof testList !== "undefined") { processTestList(customTestList); } else { if (runARES) - enableBenchmarksByGroup(ARESGroup); + enableBenchmarksByTag("ARES"); if (runCDJS) - enableBenchmarksByGroup(CDJSGroup); + enableBenchmarksByTag("CDJS"); if (runCodeLoad) - enableBenchmarksByGroup(CodeLoadGroup); + enableBenchmarksByTag("CodeLoad"); if (runOctane) - enableBenchmarksByGroup(OctaneGroup); + enableBenchmarksByTag("Octane"); if (runRexBench) - enableBenchmarksByGroup(RexBenchGroup); + enableBenchmarksByTag("RexBench"); if (runSeaMonster) - enableBenchmarksByGroup(SeaMonsterGroup); + enableBenchmarksByTag("SeaMonster"); if (runSimple) - enableBenchmarksByGroup(SimpleGroup); + enableBenchmarksByTag("Simple"); if (runSunSpider) - enableBenchmarksByGroup(SunSpiderGroup); + enableBenchmarksByTag("SunSpider"); if (runBigIntNoble) - enableBenchmarksByGroup(BigIntNobleGroup); + enableBenchmarksByTag("BigIntNoble"); if (runBigIntMisc) - enableBenchmarksByGroup(BigIntMiscGroup); + enableBenchmarksByTag("BigIntMisc"); if (runProxy) - enableBenchmarksByGroup(ProxyGroup); + enableBenchmarksByTag("Proxy"); if (runClassFields) - enableBenchmarksByGroup(ClassFieldsGroup); + enableBenchmarksByTag("ClassFields"); if (runGenerators) - enableBenchmarksByGroup(GeneratorsGroup); + enableBenchmarksByTag("Generators"); if (runWasm) - enableBenchmarksByGroup(WasmGroup); + enableBenchmarksByTag("Wasm"); if (runWorkerTests) - enableBenchmarksByGroup(WorkerTestsGroup); + enableBenchmarksByTag("WorkerTests"); if (runWSL) - enableBenchmarksByGroup(WSLGroup); + enableBenchmarksByTag("WSL"); if (runWTB) - enableBenchmarksByGroup(WTBGroup); + enableBenchmarksByTag("WTB"); } diff --git a/index.html b/index.html index 7f27e6d..b34ecae 100644 --- a/index.html +++ b/index.html @@ -53,6 +53,7 @@ await JetStream.initialize(); } catch (e) { allIsGood = false; + console.error(e); } } if (!allIsGood) { From c66122438414cb59bd57b71fc81f7e1a4e32496f Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Tue, 26 Nov 2024 14:59:04 +0100 Subject: [PATCH 2/6] cleanup --- JetStreamDriver.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 3a9f7ed..f0e9a59 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -1252,24 +1252,24 @@ class WasmBenchmark extends Benchmark { }; const TAGS = new Set([ -"ARES", -"CDJS", -"CodeLoad", -"LuaJSFight", -"Octane", -"RexBench", -"SeaMonster", -"Simple", -"SunSpider", -"BigIntNoble", -"BigIntMisc", -"Proxy", -"ClassFields", -"Generators", -"Wasm", -"WorkerTests", -"WSL", -"WTB" + "ARES", + "CDJS", + "CodeLoad", + "LuaJSFight", + "Octane", + "RexBench", + "SeaMonster", + "Simple", + "SunSpider", + "BigIntNoble", + "BigIntMisc", + "Proxy", + "ClassFields", + "Generators", + "Wasm", + "WorkerTests", + "WSL", + "WTB" ]); let BENCHMARKS = [ From a8e322494fd9582d9321ead3f870ecda007594ea Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Wed, 18 Dec 2024 15:30:05 +0100 Subject: [PATCH 3/6] fix --- JetStreamDriver.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 3f9c1ec..1a89189 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -2026,7 +2026,7 @@ for (const name of WTB_TESTS) { const benchmarksByName = new Map(); -const benchmarksByGroup = new Map(); +const benchmarksByTag = new Map(); for (const benchmark of BENCHMARKS) { const name = benchmark.name; @@ -2038,9 +2038,9 @@ for (const benchmark of BENCHMARKS) { for (const tag of benchmark.tags) { if (benchmarksByTag.has(tag)) - benchmarksByTag.get(tag).push(testName); + benchmarksByTag.get(tag).push(name); else - benchmarksByTag.set(tag, [testName]); + benchmarksByTag.set(tag, [name]); } } From adabb8d796844cf888127674042141f9bfa1f6f3 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Mon, 31 Mar 2025 14:26:29 +0200 Subject: [PATCH 4/6] address comments --- JetStreamDriver.js | 152 +++++++++++++++++++++------------------------ 1 file changed, 71 insertions(+), 81 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 32aeddb..596335f 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -570,23 +570,13 @@ class Benchmark { constructor(plan) { this.plan = plan; - this.tags = this._validateTags(plan.tags); + this.tags = new Set(plan.tags); this.iterations = getIterationCount(plan); this.isAsync = !!plan.isAsync; this.scripts = null; this._resourcesPromise = null; } - _validateTags(tags) { - const validated = new Set(); - for (const tag of tags) { - if (!TAGS.has(tag)) - throw new Error(`Invalid benchmark tag "${tag}"`); - validated.add(tag); - } - return validated; - } - get name() { return this.plan.name; } get runnerCode() { @@ -1503,7 +1493,7 @@ let BENCHMARKS = [ , "./ARES-6/Air/payload-typescript-scanIdentifier.js" , "./ARES-6/Air/benchmark.js" ], - tags: ["ARES"] + tags: ["ARES"], }), new DefaultBenchmark({ name: "Basic", @@ -1519,7 +1509,7 @@ let BENCHMARKS = [ , "./ARES-6/Basic/util.js" , "./ARES-6/Basic/benchmark.js" ], - tags: ["ARES"] + tags: ["ARES"], }), new DefaultBenchmark({ name: "ML", @@ -1528,7 +1518,7 @@ let BENCHMARKS = [ , "./ARES-6/ml/benchmark.js" ], iterations: 60, - tags: ["ARES"] + tags: ["ARES"], }), new DefaultBenchmark({ name: "Babylon", @@ -1542,7 +1532,7 @@ let BENCHMARKS = [ inspectorBlob: "./ARES-6/Babylon/inspector-blob.js", babylonBlob: "./ARES-6/Babylon/babylon-blob.js" }, - tags: ["ARES"] + tags: ["ARES"], }), // CDJS new DefaultBenchmark({ @@ -1563,7 +1553,7 @@ let BENCHMARKS = [ ], iterations: 60, worstCaseCount: 3, - tags: ["CDJS"] + tags: ["CDJS"], }), // CodeLoad new DefaultBenchmark({ @@ -1574,7 +1564,7 @@ let BENCHMARKS = [ preload: { inspectorPayloadBlob: "./code-load/inspector-payload-minified.js" }, - tags: ["CodeLoad"] + tags: ["CodeLoad"], }), new DefaultBenchmark({ name: "multi-inspector-code-load", @@ -1584,7 +1574,7 @@ let BENCHMARKS = [ preload: { inspectorPayloadBlob: "./code-load/inspector-payload-minified.js" }, - tags: ["CodeLoad"] + tags: ["CodeLoad"], }), // Octane new DefaultBenchmark({ @@ -1593,7 +1583,7 @@ let BENCHMARKS = [ "./Octane/box2d.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "octane-code-load", @@ -1601,7 +1591,7 @@ let BENCHMARKS = [ "./Octane/code-first-load.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "crypto", @@ -1609,7 +1599,7 @@ let BENCHMARKS = [ "./Octane/crypto.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "delta-blue", @@ -1617,7 +1607,7 @@ let BENCHMARKS = [ "./Octane/deltablue.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "earley-boyer", @@ -1625,7 +1615,7 @@ let BENCHMARKS = [ "./Octane/earley-boyer.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "gbemu", @@ -1634,7 +1624,7 @@ let BENCHMARKS = [ , "./Octane/gbemu-part2.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "mandreel", @@ -1643,7 +1633,7 @@ let BENCHMARKS = [ ], iterations: 80, deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "navier-stokes", @@ -1651,7 +1641,7 @@ let BENCHMARKS = [ "./Octane/navier-stokes.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "pdfjs", @@ -1659,14 +1649,14 @@ let BENCHMARKS = [ "./Octane/pdfjs.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "raytrace", files: [ "./Octane/raytrace.js" ], - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "regexp", @@ -1674,7 +1664,7 @@ let BENCHMARKS = [ "./Octane/regexp.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "richards", @@ -1682,7 +1672,7 @@ let BENCHMARKS = [ "./Octane/richards.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "splay", @@ -1690,7 +1680,7 @@ let BENCHMARKS = [ "./Octane/splay.js" ], deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), new DefaultBenchmark({ name: "typescript", @@ -1702,7 +1692,7 @@ let BENCHMARKS = [ iterations: 15, worstCaseCount: 2, deterministicRandom: true, - tags: ["Octane"] + tags: ["Octane"], }), // RexBench new DefaultBenchmark({ @@ -1714,7 +1704,7 @@ let BENCHMARKS = [ , "./RexBench/FlightPlanner/expectations.js" , "./RexBench/FlightPlanner/benchmark.js" ], - tags: ["RexBench"] + tags: ["RexBench"], }), new DefaultBenchmark({ name: "OfflineAssembler", @@ -1732,7 +1722,7 @@ let BENCHMARKS = [ , "./RexBench/OfflineAssembler/benchmark.js" ], iterations: 80, - tags: ["RexBench"] + tags: ["RexBench"], }), new DefaultBenchmark({ name: "UniPoker", @@ -1742,7 +1732,7 @@ let BENCHMARKS = [ , "./RexBench/UniPoker/benchmark.js" ], deterministicRandom: true, - tags: ["RexBench"] + tags: ["RexBench"], }), // Simple new DefaultBenchmark({ @@ -1750,21 +1740,21 @@ let BENCHMARKS = [ files: [ "./simple/hash-map.js" ], - tags: ["Simple"] + tags: ["Simple"], }), new AsyncBenchmark({ name: "doxbee-promise", files: [ "./simple/doxbee-promise.js", ], - tags: ["Simple",] + tags: ["Simple",], }), new AsyncBenchmark({ name: "doxbee-async", files: [ "./simple/doxbee-async.js", ], - tags: ["Simple",] + tags: ["Simple",], }), // SeaMonster new DefaultBenchmark({ @@ -1772,14 +1762,14 @@ let BENCHMARKS = [ files: [ "./SeaMonster/ai-astar.js" ], - tags: ["SeaMonster"] + tags: ["SeaMonster"], }), new DefaultBenchmark({ name: "gaussian-blur", files: [ "./SeaMonster/gaussian-blur.js" ], - tags: ["SeaMonster"] + tags: ["SeaMonster"], }), new DefaultBenchmark({ name: "stanford-crypto-aes", @@ -1787,7 +1777,7 @@ let BENCHMARKS = [ "./SeaMonster/sjlc.js" , "./SeaMonster/stanford-crypto-aes.js" ], - tags: ["SeaMonster"] + tags: ["SeaMonster"], }), new DefaultBenchmark({ name: "stanford-crypto-pbkdf2", @@ -1795,7 +1785,7 @@ let BENCHMARKS = [ "./SeaMonster/sjlc.js" , "./SeaMonster/stanford-crypto-pbkdf2.js" ], - tags: ["SeaMonster"] + tags: ["SeaMonster"], }), new DefaultBenchmark({ name: "stanford-crypto-sha256", @@ -1803,7 +1793,7 @@ let BENCHMARKS = [ "./SeaMonster/sjlc.js" , "./SeaMonster/stanford-crypto-sha256.js" ], - tags: ["SeaMonster"] + tags: ["SeaMonster"], }), new DefaultBenchmark({ name: "json-stringify-inspector", @@ -1813,7 +1803,7 @@ let BENCHMARKS = [ ], iterations: 20, worstCaseCount: 2, - tags: ["SeaMonster"] + tags: ["SeaMonster"], }), new DefaultBenchmark({ name: "json-parse-inspector", @@ -1823,7 +1813,7 @@ let BENCHMARKS = [ ], iterations: 20, worstCaseCount: 2, - tags: ["SeaMonster"] + tags: ["SeaMonster"], }), // BigInt new AsyncBenchmark({ @@ -1836,7 +1826,7 @@ let BENCHMARKS = [ iterations: 4, worstCaseCount: 1, deterministicRandom: true, - tags: ["BigIntNoble",] + tags: ["BigIntNoble",], }), new AsyncBenchmark({ name: "bigint-noble-secp256k1", @@ -1846,7 +1836,7 @@ let BENCHMARKS = [ "./bigint/noble-benchmark.js", ], deterministicRandom: true, - tags: ["BigIntNoble",] + tags: ["BigIntNoble",], }), new AsyncBenchmark({ name: "bigint-noble-ed25519", @@ -1857,7 +1847,7 @@ let BENCHMARKS = [ ], iterations: 30, deterministicRandom: true, - tags: ["BigIntNoble",] + tags: ["BigIntNoble",], }), new DefaultBenchmark({ name: "bigint-paillier", @@ -1869,7 +1859,7 @@ let BENCHMARKS = [ iterations: 10, worstCaseCount: 2, deterministicRandom: true, - tags: ["BigIntMisc",] + tags: ["BigIntMisc",], }), new DefaultBenchmark({ name: "bigint-bigdenary", @@ -1879,7 +1869,7 @@ let BENCHMARKS = [ ], iterations: 160, worstCaseCount: 16, - tags: ["BigIntMisc",] + tags: ["BigIntMisc",], }), // Proxy new AsyncBenchmark({ @@ -1891,7 +1881,7 @@ let BENCHMARKS = [ ], iterations: defaultIterationCount * 3, worstCaseCount: defaultWorstCaseCount * 3, - tags: ["Proxy",] + tags: ["Proxy",], }), new AsyncBenchmark({ name: "proxy-vue", @@ -1900,7 +1890,7 @@ let BENCHMARKS = [ "./proxy/vue-bundle.js", "./proxy/vue-benchmark.js", ], - tags: ["Proxy",] + tags: ["Proxy",], }), // Class fields new DefaultBenchmark({ @@ -1908,14 +1898,14 @@ let BENCHMARKS = [ files: [ "./class-fields/raytrace-public-class-fields.js", ], - tags: ["ClassFields",] + tags: ["ClassFields",], }), new DefaultBenchmark({ name: "raytrace-private-class-fields", files: [ "./class-fields/raytrace-private-class-fields.js", ], - tags: ["ClassFields",] + tags: ["ClassFields",], }), // Generators new AsyncBenchmark({ @@ -1926,7 +1916,7 @@ let BENCHMARKS = [ iterations: 80, worstCaseCount: 6, deterministicRandom: true, - tags: ["Generators",] + tags: ["Generators",], }), new DefaultBenchmark({ name: "sync-fs", @@ -1936,21 +1926,21 @@ let BENCHMARKS = [ iterations: 80, worstCaseCount: 6, deterministicRandom: true, - tags: ["Generators",] + tags: ["Generators",], }), new DefaultBenchmark({ name: "lazy-collections", files: [ "./generators/lazy-collections.js", ], - tags: ["Generators",] + tags: ["Generators",], }), new DefaultBenchmark({ name: "js-tokens", files: [ "./generators/js-tokens.js", ], - tags: ["Generators",] + tags: ["Generators",], }), // Wasm new WasmEMCCBenchmark({ @@ -1963,7 +1953,7 @@ let BENCHMARKS = [ wasmBinary: "./wasm/HashSet/build/HashSet.wasm" }, iterations: 50, - tags: ["Wasm"] + tags: ["Wasm"], }), new WasmEMCCBenchmark({ name: "tsf-wasm", @@ -1975,7 +1965,7 @@ let BENCHMARKS = [ wasmBinary: "./wasm/TSF/build/tsf.wasm" }, iterations: 50, - tags: ["Wasm"] + tags: ["Wasm"], }), new WasmEMCCBenchmark({ name: "quicksort-wasm", @@ -1987,7 +1977,7 @@ let BENCHMARKS = [ wasmBinary: "./wasm/quicksort/build/quicksort.wasm" }, iterations: 50, - tags: ["Wasm"] + tags: ["Wasm"], }), new WasmEMCCBenchmark({ name: "gcc-loops-wasm", @@ -1999,7 +1989,7 @@ let BENCHMARKS = [ wasmBinary: "./wasm/gcc-loops/build/gcc-loops.wasm" }, iterations: 50, - tags: ["Wasm"] + tags: ["Wasm"], }), new WasmEMCCBenchmark({ name: "richards-wasm", @@ -2011,7 +2001,7 @@ let BENCHMARKS = [ wasmBinary: "./wasm/richards/build/richards.wasm" }, iterations: 50, - tags: ["Wasm"] + tags: ["Wasm"], }), new WasmEMCCBenchmark({ name: "sqlite3-wasm", @@ -2024,7 +2014,7 @@ let BENCHMARKS = [ }, iterations: 30, worstCaseCount: 2, - tags: ["Wasm"] + tags: ["Wasm"], }), new WasmEMCCBenchmark({ name: "Dart-flute-wasm", @@ -2056,7 +2046,7 @@ let BENCHMARKS = [ }, async: true, deterministicRandom: true, - tags: ["Wasm"] + tags: ["Wasm"], }), new WasmLegacyBenchmark({ name: "tfjs-wasm-simd", @@ -2076,7 +2066,7 @@ let BENCHMARKS = [ }, async: true, deterministicRandom: true, - tags: ["Wasm"] + tags: ["Wasm"], }), new WasmEMCCBenchmark({ name: "argon2-wasm", @@ -2090,7 +2080,7 @@ let BENCHMARKS = [ iterations: 30, worstCaseCount: 3, deterministicRandom: true, - tags: ["Wasm"] + tags: ["Wasm"], }), // WorkerTests new AsyncBenchmark({ @@ -2127,7 +2117,7 @@ let BENCHMARKS = [ , stringUnpackCode: "./worker/bomb-subtests/string-unpack-code.js" , regexpDNA: "./worker/bomb-subtests/regexp-dna.js" }, - tags: ["WorkerTests"] + tags: ["WorkerTests"], }), new AsyncBenchmark({ name: "segmentation", @@ -2139,13 +2129,13 @@ let BENCHMARKS = [ }, iterations: 36, worstCaseCount: 3, - tags: ["WorkerTests"] + tags: ["WorkerTests"], }), // WSL new WSLBenchmark({ name: "WSL", files: ["./WSL/Node.js" ,"./WSL/Type.js" ,"./WSL/ReferenceType.js" ,"./WSL/Value.js" ,"./WSL/Expression.js" ,"./WSL/Rewriter.js" ,"./WSL/Visitor.js" ,"./WSL/CreateLiteral.js" ,"./WSL/CreateLiteralType.js" ,"./WSL/PropertyAccessExpression.js" ,"./WSL/AddressSpace.js" ,"./WSL/AnonymousVariable.js" ,"./WSL/ArrayRefType.js" ,"./WSL/ArrayType.js" ,"./WSL/Assignment.js" ,"./WSL/AutoWrapper.js" ,"./WSL/Block.js" ,"./WSL/BoolLiteral.js" ,"./WSL/Break.js" ,"./WSL/CallExpression.js" ,"./WSL/CallFunction.js" ,"./WSL/Check.js" ,"./WSL/CheckLiteralTypes.js" ,"./WSL/CheckLoops.js" ,"./WSL/CheckRecursiveTypes.js" ,"./WSL/CheckRecursion.js" ,"./WSL/CheckReturns.js" ,"./WSL/CheckUnreachableCode.js" ,"./WSL/CheckWrapped.js" ,"./WSL/Checker.js" ,"./WSL/CloneProgram.js" ,"./WSL/CommaExpression.js" ,"./WSL/ConstexprFolder.js" ,"./WSL/ConstexprTypeParameter.js" ,"./WSL/Continue.js" ,"./WSL/ConvertPtrToArrayRefExpression.js" ,"./WSL/DereferenceExpression.js" ,"./WSL/DoWhileLoop.js" ,"./WSL/DotExpression.js" ,"./WSL/DoubleLiteral.js" ,"./WSL/DoubleLiteralType.js" ,"./WSL/EArrayRef.js" ,"./WSL/EBuffer.js" ,"./WSL/EBufferBuilder.js" ,"./WSL/EPtr.js" ,"./WSL/EnumLiteral.js" ,"./WSL/EnumMember.js" ,"./WSL/EnumType.js" ,"./WSL/EvaluationCommon.js" ,"./WSL/Evaluator.js" ,"./WSL/ExpressionFinder.js" ,"./WSL/ExternalOrigin.js" ,"./WSL/Field.js" ,"./WSL/FindHighZombies.js" ,"./WSL/FlattenProtocolExtends.js" ,"./WSL/FlattenedStructOffsetGatherer.js" ,"./WSL/FloatLiteral.js" ,"./WSL/FloatLiteralType.js" ,"./WSL/FoldConstexprs.js" ,"./WSL/ForLoop.js" ,"./WSL/Func.js" ,"./WSL/FuncDef.js" ,"./WSL/FuncInstantiator.js" ,"./WSL/FuncParameter.js" ,"./WSL/FunctionLikeBlock.js" ,"./WSL/HighZombieFinder.js" ,"./WSL/IdentityExpression.js" ,"./WSL/IfStatement.js" ,"./WSL/IndexExpression.js" ,"./WSL/InferTypesForCall.js" ,"./WSL/Inline.js" ,"./WSL/Inliner.js" ,"./WSL/InstantiateImmediates.js" ,"./WSL/IntLiteral.js" ,"./WSL/IntLiteralType.js" ,"./WSL/Intrinsics.js" ,"./WSL/LateChecker.js" ,"./WSL/Lexer.js" ,"./WSL/LexerToken.js" ,"./WSL/LiteralTypeChecker.js" ,"./WSL/LogicalExpression.js" ,"./WSL/LogicalNot.js" ,"./WSL/LoopChecker.js" ,"./WSL/MakeArrayRefExpression.js" ,"./WSL/MakePtrExpression.js" ,"./WSL/NameContext.js" ,"./WSL/NameFinder.js" ,"./WSL/NameResolver.js" ,"./WSL/NativeFunc.js" ,"./WSL/NativeFuncInstance.js" ,"./WSL/NativeType.js" ,"./WSL/NativeTypeInstance.js" ,"./WSL/NormalUsePropertyResolver.js" ,"./WSL/NullLiteral.js" ,"./WSL/NullType.js" ,"./WSL/OriginKind.js" ,"./WSL/OverloadResolutionFailure.js" ,"./WSL/Parse.js" ,"./WSL/Prepare.js" ,"./WSL/Program.js" ,"./WSL/ProgramWithUnnecessaryThingsRemoved.js" ,"./WSL/PropertyResolver.js" ,"./WSL/Protocol.js" ,"./WSL/ProtocolDecl.js" ,"./WSL/ProtocolFuncDecl.js" ,"./WSL/ProtocolRef.js" ,"./WSL/PtrType.js" ,"./WSL/ReadModifyWriteExpression.js" ,"./WSL/RecursionChecker.js" ,"./WSL/RecursiveTypeChecker.js" ,"./WSL/ResolveNames.js" ,"./WSL/ResolveOverloadImpl.js" ,"./WSL/ResolveProperties.js" ,"./WSL/ResolveTypeDefs.js" ,"./WSL/Return.js" ,"./WSL/ReturnChecker.js" ,"./WSL/ReturnException.js" ,"./WSL/StandardLibrary.js" ,"./WSL/StatementCloner.js" ,"./WSL/StructLayoutBuilder.js" ,"./WSL/StructType.js" ,"./WSL/Substitution.js" ,"./WSL/SwitchCase.js" ,"./WSL/SwitchStatement.js" ,"./WSL/SynthesizeEnumFunctions.js" ,"./WSL/SynthesizeStructAccessors.js" ,"./WSL/TrapStatement.js" ,"./WSL/TypeDef.js" ,"./WSL/TypeDefResolver.js" ,"./WSL/TypeOrVariableRef.js" ,"./WSL/TypeParameterRewriter.js" ,"./WSL/TypeRef.js" ,"./WSL/TypeVariable.js" ,"./WSL/TypeVariableTracker.js" ,"./WSL/TypedValue.js" ,"./WSL/UintLiteral.js" ,"./WSL/UintLiteralType.js" ,"./WSL/UnificationContext.js" ,"./WSL/UnreachableCodeChecker.js" ,"./WSL/VariableDecl.js" ,"./WSL/VariableRef.js" ,"./WSL/VisitingSet.js" ,"./WSL/WSyntaxError.js" ,"./WSL/WTrapError.js" ,"./WSL/WTypeError.js" ,"./WSL/WhileLoop.js" ,"./WSL/WrapChecker.js", "./WSL/Test.js"], - tags: ["WSL"] + tags: ["WSL"], }), // 8bitbench new WasmEMCCBenchmark({ @@ -2161,7 +2151,7 @@ let BENCHMARKS = [ }, iterations: 15, worstCaseCount: 2, - tags: ["Wasm"] + tags: ["Wasm"], }), // zlib-wasm new WasmEMCCBenchmark({ @@ -2174,7 +2164,7 @@ let BENCHMARKS = [ wasmBinary: "./wasm/zlib/build/zlib.wasm", }, iterations: 40, - tags: ["Wasm"] + tags: ["Wasm"], }), ]; @@ -2191,7 +2181,7 @@ for (const test of luaJSFightTests) { files: [ `./LuaJSFight/${test}.js` ], - tags: ["LuaJSFight"] + tags: ["LuaJSFight"], })); } @@ -2216,7 +2206,7 @@ for (const test of SUNSPIDER_TESTS) { files: [ `./SunSpider/${test}.js` ], - tags: ["SunSpider"] + tags: ["SunSpider"], })); } @@ -2241,7 +2231,7 @@ for (const name of WTB_TESTS) { ], iterations: 5, worstCaseCount: 1, - tags: ["WTB"] + tags: ["WTB"], })); } @@ -2259,9 +2249,9 @@ for (const benchmark of BENCHMARKS) { for (const tag of benchmark.tags) { if (benchmarksByTag.has(tag)) - benchmarksByTag.get(tag).push(name); + benchmarksByTag.get(tag).push(benchmark); else - benchmarksByTag.set(tag, [name]); + benchmarksByTag.set(tag, [benchmark]); } } @@ -2279,15 +2269,15 @@ function enableBenchmarksByName(name) function enableBenchmarksByTag(tag) { - const benchmarkNames = benchmarksByTag.get(tag); + const benchmarks = benchmarksByTag.get(tag); - if (!benchmarkNames) { + if (!benchmarks) { const validTags = Array.from(benchmarksByTag.keys()).join(", "); throw new Error(`Couldn't find tag named: ${tag}.\n Choices are ${validTags}`); } - for (let name of benchmarkNames) - enableBenchmarksByName(name); + for (let benchmark of benchmarks) + JetStream.addBenchmark(benchmark); } function processTestList(testList) From 4f3b3dccf9f3a78c3b95202e7f932c460f3b0aca Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Mon, 7 Apr 2025 12:14:50 +0200 Subject: [PATCH 5/6] remove tags array comma --- JetStreamDriver.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index 596335f..bd9e13b 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -1747,14 +1747,14 @@ let BENCHMARKS = [ files: [ "./simple/doxbee-promise.js", ], - tags: ["Simple",], + tags: ["Simple"], }), new AsyncBenchmark({ name: "doxbee-async", files: [ "./simple/doxbee-async.js", ], - tags: ["Simple",], + tags: ["Simple"], }), // SeaMonster new DefaultBenchmark({ @@ -1826,7 +1826,7 @@ let BENCHMARKS = [ iterations: 4, worstCaseCount: 1, deterministicRandom: true, - tags: ["BigIntNoble",], + tags: ["BigIntNoble"], }), new AsyncBenchmark({ name: "bigint-noble-secp256k1", @@ -1836,7 +1836,7 @@ let BENCHMARKS = [ "./bigint/noble-benchmark.js", ], deterministicRandom: true, - tags: ["BigIntNoble",], + tags: ["BigIntNoble"], }), new AsyncBenchmark({ name: "bigint-noble-ed25519", @@ -1847,7 +1847,7 @@ let BENCHMARKS = [ ], iterations: 30, deterministicRandom: true, - tags: ["BigIntNoble",], + tags: ["BigIntNoble"], }), new DefaultBenchmark({ name: "bigint-paillier", @@ -1859,7 +1859,7 @@ let BENCHMARKS = [ iterations: 10, worstCaseCount: 2, deterministicRandom: true, - tags: ["BigIntMisc",], + tags: ["BigIntMisc"], }), new DefaultBenchmark({ name: "bigint-bigdenary", @@ -1869,7 +1869,7 @@ let BENCHMARKS = [ ], iterations: 160, worstCaseCount: 16, - tags: ["BigIntMisc",], + tags: ["BigIntMisc"], }), // Proxy new AsyncBenchmark({ @@ -1881,7 +1881,7 @@ let BENCHMARKS = [ ], iterations: defaultIterationCount * 3, worstCaseCount: defaultWorstCaseCount * 3, - tags: ["Proxy",], + tags: ["Proxy"], }), new AsyncBenchmark({ name: "proxy-vue", @@ -1890,7 +1890,7 @@ let BENCHMARKS = [ "./proxy/vue-bundle.js", "./proxy/vue-benchmark.js", ], - tags: ["Proxy",], + tags: ["Proxy"] }), // Class fields new DefaultBenchmark({ @@ -1898,14 +1898,14 @@ let BENCHMARKS = [ files: [ "./class-fields/raytrace-public-class-fields.js", ], - tags: ["ClassFields",], + tags: ["ClassFields"] }), new DefaultBenchmark({ name: "raytrace-private-class-fields", files: [ "./class-fields/raytrace-private-class-fields.js", ], - tags: ["ClassFields",], + tags: ["ClassFields"] }), // Generators new AsyncBenchmark({ @@ -1916,7 +1916,7 @@ let BENCHMARKS = [ iterations: 80, worstCaseCount: 6, deterministicRandom: true, - tags: ["Generators",], + tags: ["Generators"] }), new DefaultBenchmark({ name: "sync-fs", @@ -1926,21 +1926,21 @@ let BENCHMARKS = [ iterations: 80, worstCaseCount: 6, deterministicRandom: true, - tags: ["Generators",], + tags: ["Generators"] }), new DefaultBenchmark({ name: "lazy-collections", files: [ "./generators/lazy-collections.js", ], - tags: ["Generators",], + tags: ["Generators"] }), new DefaultBenchmark({ name: "js-tokens", files: [ "./generators/js-tokens.js", ], - tags: ["Generators",], + tags: ["Generators"] }), // Wasm new WasmEMCCBenchmark({ From 1a40694af662a387164ddbd1994ed179f0f839c6 Mon Sep 17 00:00:00 2001 From: Camillo Bruni Date: Mon, 7 Apr 2025 12:17:43 +0200 Subject: [PATCH 6/6] remove unused TAGS set --- JetStreamDriver.js | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/JetStreamDriver.js b/JetStreamDriver.js index bd9e13b..e701d0f 100644 --- a/JetStreamDriver.js +++ b/JetStreamDriver.js @@ -1445,27 +1445,6 @@ class WasmLegacyBenchmark extends Benchmark { } }; -const TAGS = new Set([ - "ARES", - "CDJS", - "CodeLoad", - "LuaJSFight", - "Octane", - "RexBench", - "SeaMonster", - "Simple", - "SunSpider", - "BigIntNoble", - "BigIntMisc", - "Proxy", - "ClassFields", - "Generators", - "Wasm", - "WorkerTests", - "WSL", - "WTB" -]); - let BENCHMARKS = [ // ARES new DefaultBenchmark({