Skip to content

Commit

Permalink
enable simd by default in tests and benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlup committed Apr 27, 2021
1 parent 49d7508 commit 5bb053d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
run: npm i
- name: Run Benchmark
run: npm run bench
- name: Run simd Benchmark
run: npm run bench:simd

benchmark_branch:
name: benchmark branch
Expand All @@ -37,5 +35,3 @@ jobs:
run: npm i
- name: Run Benchmark
run: npm run bench
- name: Run simd Benchmark
run: npm run bench:simd
1 change: 1 addition & 0 deletions .taprc
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ coverage: true
expose-gc: true
timeout: 60
check-coverage: false
node-arg: --experimental-wasm-simd
36 changes: 20 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,29 @@ number of unix sockets (connections) with a pipelining depth of 10.

### Connections 1

| Test | Samples | Result | Tolerance | Difference with slowest |
|---------------------|---------|----------------|-----------|-------------------------|
| http - no keepalive | 99 | 812 reqs/sec | ± 0.22 % | |
| http - keepalive | 99 | 819 reqs/sec | ± 0.20 % | + 0.82 % |
| undici - pipeline | 99 | 6632 reqs/sec | ± 0.63 % | + 716.73 % |
| undici - request | 99 | 6645 reqs/sec | ± 1.34 % | + 718.34 % |
| undici - stream | 99 | 7366 reqs/sec | ± 0.59 % | + 807.11 % |
| undici - dispatch | 99 | 7404 reqs/sec | ± 0.37 % | + 811.76 % |
| Tests | Samples | Result | Tolerance | Difference with slowest |
|---------------------|---------|---------------|-----------|-------------------------|
| http - no keepalive | 15 | 4.63 req/sec | ± 2.77 % | - |
| http - keepalive | 10 | 4.81 req/sec | ± 2.16 % | + 3.94 % |
| undici - stream | 25 | 62.22 req/sec | ± 2.67 % | + 1244.58 % |
| undici - dispatch | 15 | 64.33 req/sec | ± 2.47 % | + 1290.24 % |
| undici - request | 15 | 66.08 req/sec | ± 2.48 % | + 1327.88 % |
| undici - pipeline | 10 | 66.13 req/sec | ± 1.39 % | + 1329.08 % |

### Connections 50

| Test | Samples | Result | Tolerance | Difference with slowest |
|---------------------|---------|----------------|-----------|-------------------------|
| http - no keepalive | 99 | 12968 reqs/sec | ± 1.86 % | |
| http - keepalive | 99 | 14745 reqs/sec | ± 1.59 % | + 13.70 % |
| undici - pipeline | 99 | 20051 reqs/sec | ± 2.34 % | + 54.62 % |
| undici - stream | 100 | 26456 reqs/sec | ± 3.50 % | + 104.00 % |
| undici - request | 99 | 29342 reqs/sec | ± 1.26 % | + 126.26 % |
| undici - dispatch | 99 | 35323 reqs/sec | ± 0.77 % | + 172.38 % |
| Tests | Samples | Result | Tolerance | Difference with slowest |
|---------------------|---------|------------------|-----------|-------------------------|
| http - no keepalive | 50 | 3546.49 req/sec | ± 2.90 % | - |
| http - keepalive | 15 | 5692.67 req/sec | ± 2.48 % | + 60.52 % |
| undici - pipeline | 25 | 8478.71 req/sec | ± 2.62 % | + 139.07 % |
| undici - request | 20 | 9766.66 req/sec | ± 2.79 % | + 175.39 % |
| undici - stream | 15 | 10109.74 req/sec | ± 2.94 % | + 185.06 % |
| undici - dispatch | 25 | 10949.73 req/sec | ± 2.54 % | + 208.75 % |

#### Note

The benchmarks have the [simd](https://github.com/WebAssembly/simd) feature enabled.

## Quick Start

Expand Down
7 changes: 2 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"build:wasm": "node build/wasm.js --docker",
"lint": "standard | snazzy",
"lint:fix": "standard --fix | snazzy",
"test": "tap test/*.js --no-coverage && jest test/jest/test",
"test:simd": "tap --node-arg=--expose-gc --node-arg=--experimental-wasm-simd test/*.js --no-coverage",
"test": "tap test/*.js --no-coverage",
"test:tdd": "tap test/*.js -w --no-coverage-report",
"test:typescript": "tsd",
"coverage": "standard | snazzy && tap test/*.js",
Expand All @@ -43,9 +42,7 @@
"bench:simd": "concurrently -k -s first npm:bench:server npm:bench:run:simd",
"bench:server": "node benchmarks/server.js",
"prebench:run": "node benchmarks/wait.js",
"prebench:run:simd": "node benchmarks/wait.js",
"bench:run": "CONNECTIONS=1 node benchmarks/benchmark.js && CONNECTIONS=50 node benchmarks/benchmark.js",
"bench:run:simd": "CONNECTIONS=1 node --experimental-wasm-simd benchmarks/benchmark.js && CONNECTIONS=50 node --experimental-wasm-simd benchmarks/benchmark.js",
"bench:run": "CONNECTIONS=1 node --experimental-wasm-simd benchmarks/benchmark.js && CONNECTIONS=50 node --experimental-wasm-simd benchmarks/benchmark.js",
"serve:website": "docsify serve .",
"prepare": "husky install"
},
Expand Down

0 comments on commit 5bb053d

Please sign in to comment.