Skip to content

Commit 972dfc1

Browse files
committed
Jmeterbenchmark
test jmeter benchmarking Signed-off-by: ruzell22 <[email protected]>
1 parent fdc247e commit 972dfc1

File tree

3 files changed

+38
-15
lines changed

3 files changed

+38
-15
lines changed

.github/workflows/jmeter-benchmarking.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ jobs:
2121
- name: Run benchmark
2222
run: cd examples/benchmarkjs && npm install && node bench.js | tee output.txt
2323

24-
- name: Store benchmark result
25-
uses: benchmark-action/github-action-benchmark@v1
26-
with:
27-
tool: 'benchmarkjs'
28-
output-file-path: examples/benchmarkjs/output.txt
24+
# - name: Store benchmark result
25+
# uses: benchmark-action/github-action-benchmark@v1
26+
# with:
27+
# tool: 'benchmarkjs'
28+
# output-file-path: examples/benchmarkjs/output.txt
29+
2930

3031
# - name: Store benchmark result
3132
# uses: benchmark-action/github-action-benchmark@v1

examples/benchmarkjs/bench.js

+32-9
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,38 @@
1-
const Benchmark = require('benchmark');
2-
const suite = new Benchmark.Suite();
3-
const { fib } = require('./index');
1+
// const Benchmark = require("benchmark");
2+
var suite = new Benchmark.Suite();
43

4+
// add tests
55
suite
6-
.add("fib(10)", () => {
7-
fib(10);
6+
.add("RegExp#test", function () {
7+
/o/.test("Hello World!");
88
})
9-
.add("fib(20)", () => {
10-
fib(20);
9+
.add("String#indexOf", function () {
10+
"Hello World!".indexOf("o") > -1;
1111
})
12-
.on("cycle", (event) => {
12+
.add("String#match", function () {
13+
!!"Hello World!".match(/o/);
14+
})
15+
// add listeners
16+
.on("cycle", function (event) {
1317
console.log(String(event.target));
1418
})
15-
.run();
19+
.on("complete", function () {
20+
console.log("Fastest is " + this.filter("fastest").map("name"));
21+
})
22+
// run async
23+
.run({ async: true });
24+
25+
// const suite = new Benchmark.Suite();
26+
// const { fib } = require('./index');
27+
28+
// suite
29+
// .add("fib(10)", () => {
30+
// fib(10);
31+
// })
32+
// .add("fib(20)", () => {
33+
// fib(20);
34+
// })
35+
// .on("cycle", (event) => {
36+
// console.log(String(event.target));
37+
// })
38+
// .run();

examples/benchmarkjs/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"scripts": {
88
"test": "echo \"Error: no test specified\" && exit 1"
99
},
10-
"author": "rhysd <[email protected]> (https://rhysd.github.io/)",
1110
"license": "MIT",
1211
"devDependencies": {
1312
"benchmark": "^2.1.4"

0 commit comments

Comments
 (0)