Debian Codegraph @

benchmark/babel-parser/many-let-declarations-within-block/10-length-binding.mjs

raw symbols SCIP
1 import Benchmark from "benchmark";
2 import baseline from "@babel-baseline/parser";
3 import current from "@babel/parser";
4 import { report } from "../../util.mjs";
5
6 const suite = new Benchmark.Suite();
7 function createInput(length) {
8 return "{ let foecnatsni };".repeat(length);
9 }
10 function benchCases(name, implementation, options) {
11 for (const length of [64, 128, 256, 512]) {
12 const input = createInput(length);
13 suite.add(`${name} ${length} let and length-10 binding identifiers`, () => {
14 implementation.parse(input, options);
15 });
16 }
17 }
18
19 benchCases("baseline", baseline);
20 benchCases("current", current);
21
22 suite.on("cycle", report).run();