From 4213b48279f55466ce860aef8aed07096807b912 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 7 Sep 2023 12:17:05 +0200 Subject: [PATCH 1/2] Updated benchmarks Signed-off-by: Matteo Collina --- README.md | 52 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 05a5d21ed11..c3013a25689 100644 --- a/README.md +++ b/README.md @@ -18,30 +18,46 @@ 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 From 129cd45df81707e6c31b7eea5696684f9a5aae21 Mon Sep 17 00:00:00 2001 From: Matteo Collina Date: Thu, 7 Sep 2023 12:24:46 +0200 Subject: [PATCH 2/2] fixup Signed-off-by: Matteo Collina --- README.md | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/README.md b/README.md index c3013a25689..e6c3552ade4 100644 --- a/README.md +++ b/README.md @@ -26,17 +26,11 @@ number of unix sockets (connections) with a pipelining depth of 10 running on No │ 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 % │ @@ -45,17 +39,11 @@ number of unix sockets (connections) with a pipelining depth of 10 running on No │ 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 % │