diff --git a/.github/workflows/jmeter-benchmarking.yaml b/.github/workflows/jmeter-benchmarking.yaml index b3b5b32dab..55844c5579 100644 --- a/.github/workflows/jmeter-benchmarking.yaml +++ b/.github/workflows/jmeter-benchmarking.yaml @@ -21,11 +21,12 @@ jobs: - name: Run benchmark run: cd examples/benchmarkjs && npm install && node bench.js | tee output.txt - - name: Store benchmark result - uses: benchmark-action/github-action-benchmark@v1 - with: - tool: 'benchmarkjs' - output-file-path: examples/benchmarkjs/output.txt + # - name: Store benchmark result + # uses: benchmark-action/github-action-benchmark@v1 + # with: + # tool: 'benchmarkjs' + # output-file-path: examples/benchmarkjs/output.txt + # - name: Store benchmark result # uses: benchmark-action/github-action-benchmark@v1 diff --git a/examples/benchmarkjs/bench.js b/examples/benchmarkjs/bench.js index 3af56c73e0..89c2aca81d 100644 --- a/examples/benchmarkjs/bench.js +++ b/examples/benchmarkjs/bench.js @@ -1,15 +1,38 @@ -const Benchmark = require('benchmark'); -const suite = new Benchmark.Suite(); -const { fib } = require('./index'); +// const Benchmark = require("benchmark"); +var suite = new Benchmark.Suite(); +// add tests suite - .add("fib(10)", () => { - fib(10); + .add("RegExp#test", function () { + /o/.test("Hello World!"); }) - .add("fib(20)", () => { - fib(20); + .add("String#indexOf", function () { + "Hello World!".indexOf("o") > -1; }) - .on("cycle", (event) => { + .add("String#match", function () { + !!"Hello World!".match(/o/); + }) + // add listeners + .on("cycle", function (event) { console.log(String(event.target)); }) - .run(); + .on("complete", function () { + console.log("Fastest is " + this.filter("fastest").map("name")); + }) + // run async + .run({ async: true }); + +// const suite = new Benchmark.Suite(); +// const { fib } = require('./index'); + +// suite +// .add("fib(10)", () => { +// fib(10); +// }) +// .add("fib(20)", () => { +// fib(20); +// }) +// .on("cycle", (event) => { +// console.log(String(event.target)); +// }) +// .run(); diff --git a/examples/benchmarkjs/package.json b/examples/benchmarkjs/package.json index 42c54e4001..4503a6fc0d 100644 --- a/examples/benchmarkjs/package.json +++ b/examples/benchmarkjs/package.json @@ -7,7 +7,6 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "author": "rhysd (https://rhysd.github.io/)", "license": "MIT", "devDependencies": { "benchmark": "^2.1.4"