Skip to content

Commit

Permalink
Updated benchmarks (#2250)
Browse files Browse the repository at this point in the history
* Updated benchmarks

Signed-off-by: Matteo Collina <hello@matteocollina.com>

* fixup

Signed-off-by: Matteo Collina <hello@matteocollina.com>

---------

Signed-off-by: Matteo Collina <hello@matteocollina.com>
  • Loading branch information
mcollina committed Sep 7, 2023
1 parent 83cb522 commit 932e5f6
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,34 @@ npm i undici
## Benchmarks

The benchmark is a simple `hello world` [example](benchmarks/benchmark.js) using a
number of unix sockets (connections) with a pipelining depth of 10 running on Node 16.
The benchmarks below have the [simd](https://github.com/WebAssembly/simd) feature enabled.
number of unix sockets (connections) with a pipelining depth of 10 running on Node 20.6.0.

### Connections 1

| 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 % |

│ Tests │ Samples │ Result │ Tolerance │ Difference with slowest │
|─────────────────────|─────────|───────────────|───────────|─────────────────────────|
│ http - no keepalive │ 15 │ 5.32 req/sec │ ± 2.61 % │ - │
│ http - keepalive │ 10 │ 5.35 req/sec │ ± 2.47 % │ + 0.44 % │
│ undici - fetch │ 15 │ 41.85 req/sec │ ± 2.49 % │ + 686.04 % │
│ undici - pipeline │ 40 │ 50.36 req/sec │ ± 2.77 % │ + 845.92 % │
│ undici - stream │ 15 │ 60.58 req/sec │ ± 2.75 % │ + 1037.72 % │
│ undici - request │ 10 │ 61.19 req/sec │ ± 2.60 % │ + 1049.24 % │
│ undici - dispatch │ 20 │ 64.84 req/sec │ ± 2.81 % │ + 1117.81 % │


### Connections 50

| 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 % |
│ Tests │ Samples │ Result │ Tolerance │ Difference with slowest │
|─────────────────────|─────────|──────────────────|───────────|─────────────────────────|
│ undici - fetch │ 30 │ 2107.19 req/sec │ ± 2.69 % │ - │
│ http - no keepalive │ 10 │ 2698.90 req/sec │ ± 2.68 % │ + 28.08 % │
│ http - keepalive │ 10 │ 4639.49 req/sec │ ± 2.55 % │ + 120.17 % │
│ undici - pipeline │ 40 │ 6123.33 req/sec │ ± 2.97 % │ + 190.59 % │
│ undici - stream │ 50 │ 9426.51 req/sec │ ± 2.92 % │ + 347.35 % │
│ undici - request │ 10 │ 10162.88 req/sec │ ± 2.13 % │ + 382.29 % │
│ undici - dispatch │ 50 │ 11191.11 req/sec │ ± 2.98 % │ + 431.09 % │


## Quick Start

Expand Down

0 comments on commit 932e5f6

Please sign in to comment.