Skip to content

Instantly share code, notes, and snippets.

@voltbit
Created January 11, 2022 11:53
Show Gist options
  • Save voltbit/41828df848a7132c1aad196414ea2d69 to your computer and use it in GitHub Desktop.
Save voltbit/41828df848a7132c1aad196414ea2d69 to your computer and use it in GitHub Desktop.
prom-client benchmark 3
❯ node index.js
# Benchmark Regression
## Installing baseline packages
http fetch GET 200 https://registry.npmjs.org/prom-client 1025ms
http fetch GET 200 https://registry.npmjs.org/prom-client/-/prom-client-14.0.1.tgz 55ms
+ prom-client@14.0.1
added 3 packages from 3 contributors and audited 3 packages in 2.211s
found 0 vulnerabilities
## Starting benchmark suite
### Progress:
- registry ➭ getMetricsAsJSON#1 with 64 ➭ current x 2,310 ops/sec ±8.06% (74 runs sampled)
- registry ➭ getMetricsAsJSON#1 with 64 ➭ prom-client@latest x 2,392 ops/sec ±8.47% (75 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 8 ➭ current x 1,927 ops/sec ±6.22% (74 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 8 ➭ prom-client@latest x 1,974 ops/sec ±6.84% (72 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 4 and 2 with 2 ➭ current x 1,636 ops/sec ±5.88% (75 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 4 and 2 with 2 ➭ prom-client@latest x 1,635 ops/sec ±6.98% (73 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 2 and 2 with 4 ➭ current x 1,644 ops/sec ±6.23% (77 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 2 and 2 with 4 ➭ prom-client@latest x 1,588 ops/sec ±8.35% (81 runs sampled)
- registry ➭ getMetricsAsJSON#6 with 2 ➭ current x 1,468 ops/sec ±7.13% (78 runs sampled)
- registry ➭ getMetricsAsJSON#6 with 2 ➭ prom-client@latest x 1,460 ops/sec ±9.16% (62 runs sampled)
- registry ➭ metrics#1 with 64 ➭ current x 2,049 ops/sec ±5.60% (74 runs sampled)
- registry ➭ metrics#1 with 64 ➭ prom-client@latest x 2,239 ops/sec ±7.61% (75 runs sampled)
- registry ➭ metrics#2 with 8 ➭ current x 2,022 ops/sec ±5.46% (74 runs sampled)
- registry ➭ metrics#2 with 8 ➭ prom-client@latest x 2,020 ops/sec ±5.60% (65 runs sampled)
- registry ➭ metrics#2 with 4 and 2 with 2 ➭ current x 1,692 ops/sec ±6.20% (73 runs sampled)
- registry ➭ metrics#2 with 4 and 2 with 2 ➭ prom-client@latest x 1,678 ops/sec ±7.87% (76 runs sampled)
- registry ➭ metrics#2 with 2 and 2 with 4 ➭ current x 1,708 ops/sec ±5.99% (78 runs sampled)
- registry ➭ metrics#2 with 2 and 2 with 4 ➭ prom-client@latest x 1,801 ops/sec ±6.11% (79 runs sampled)
- registry ➭ metrics#6 with 2 ➭ current x 1,588 ops/sec ±1.54% (79 runs sampled)
- registry ➭ metrics#6 with 2 ➭ prom-client@latest x 1,527 ops/sec ±6.44% (75 runs sampled)
- histogram ➭ observe#1 with 64 ➭ current x 46,585 ops/sec ±1.12% (90 runs sampled)
- histogram ➭ observe#1 with 64 ➭ prom-client@latest x 45,114 ops/sec ±0.92% (92 runs sampled)
- histogram ➭ observe#2 with 8 ➭ current x 16,763 ops/sec ±0.88% (88 runs sampled)
- histogram ➭ observe#2 with 8 ➭ prom-client@latest x 16,792 ops/sec ±0.84% (86 runs sampled)
- histogram ➭ observe#2 with 4 and 2 with 2 ➭ current x 11,626 ops/sec ±1.14% (89 runs sampled)
- histogram ➭ observe#2 with 4 and 2 with 2 ➭ prom-client@latest x 11,125 ops/sec ±1.22% (84 runs sampled)
- histogram ➭ observe#2 with 2 and 2 with 4 ➭ current x 11,183 ops/sec ±0.82% (90 runs sampled)
- histogram ➭ observe#2 with 2 and 2 with 4 ➭ prom-client@latest x 11,167 ops/sec ±0.93% (88 runs sampled)
- histogram ➭ observe#6 with 2 ➭ current x 8,483 ops/sec ±0.96% (86 runs sampled)
- histogram ➭ observe#6 with 2 ➭ prom-client@latest x 8,277 ops/sec ±0.80% (82 runs sampled)
- gauge ➭ inc ➭ current x 9,266,624 ops/sec ±0.84% (91 runs sampled)
- gauge ➭ inc ➭ prom-client@latest x 8,538,193 ops/sec ±0.77% (88 runs sampled)
- gauge ➭ inc with labels ➭ current x 11,474 ops/sec ±1.26% (91 runs sampled)
- gauge ➭ inc with labels ➭ prom-client@latest x 11,501 ops/sec ±0.91% (91 runs sampled)
- summary ➭ observe#1 with 64 ➭ current x 41,678 ops/sec ±0.84% (91 runs sampled)
- summary ➭ observe#1 with 64 ➭ prom-client@latest x 39,512 ops/sec ±1.58% (86 runs sampled)
- summary ➭ observe#2 with 8 ➭ current x 16,184 ops/sec ±0.96% (89 runs sampled)
- summary ➭ observe#2 with 8 ➭ prom-client@latest x 16,324 ops/sec ±1.03% (88 runs sampled)
- summary ➭ observe#2 with 4 and 2 with 2 ➭ current x 10,624 ops/sec ±0.92% (89 runs sampled)
- summary ➭ observe#2 with 4 and 2 with 2 ➭ prom-client@latest x 10,291 ops/sec ±1.78% (84 runs sampled)
- summary ➭ observe#2 with 2 and 2 with 4 ➭ current x 10,180 ops/sec ±1.29% (85 runs sampled)
- summary ➭ observe#2 with 2 and 2 with 4 ➭ prom-client@latest x 10,296 ops/sec ±1.50% (83 runs sampled)
- summary ➭ observe#6 with 2 ➭ current x 7,882 ops/sec ±1.24% (87 runs sampled)
- summary ➭ observe#6 with 2 ➭ prom-client@latest x 8,187 ops/sec ±1.04% (89 runs sampled)
### Results:
┌────────────────────────────────────────┬────────────────────┬────────────────────┐
│ registry │ current │ prom-client@latest │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#1 with 64 │ 2309.8274062962482 │ 2391.6568307413295 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#2 with 8 │ 1927.3368722762186 │ 1973.969873955944 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#2 with 4 and 2 with 2 │ 1635.9987664218324 │ 1634.7206364971194 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#2 with 2 and 2 with 4 │ 1644.1295868072596 │ 1587.998413338639 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#6 with 2 │ 1468.1779969077652 │ 1459.7563050329134 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#1 with 64 │ 2048.6834165704313 │ 2239.281569465615 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#2 with 8 │ 2021.5811684704622 │ 2020.25747564183 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#2 with 4 and 2 with 2 │ 1692.1970045949295 │ 1677.654084714136 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#2 with 2 and 2 with 4 │ 1707.9410886708247 │ 1800.6484463487018 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#6 with 2 │ 1587.7359006294737 │ 1526.5175677772122 │
└────────────────────────────────────────┴────────────────────┴────────────────────┘
┌───────────────────────────────┬────────────────────┬────────────────────┐
│ histogram │ current │ prom-client@latest │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#1 with 64 │ 46585.35574357135 │ 45114.028985041696 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 8 │ 16763.48802914647 │ 16791.612478283765 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 4 and 2 with 2 │ 11626.30763482925 │ 11124.940888908706 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 2 and 2 with 4 │ 11182.560540313665 │ 11166.741331606141 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#6 with 2 │ 8482.93060668103 │ 8276.878748760097 │
└───────────────────────────────┴────────────────────┴────────────────────┘
┌─────────────────┬────────────────────┬────────────────────┐
│ gauge │ current │ prom-client@latest │
├─────────────────┼────────────────────┼────────────────────┤
│ inc │ 9266623.653895313 │ 8538192.640229173 │
├─────────────────┼────────────────────┼────────────────────┤
│ inc with labels │ 11474.360322713934 │ 11500.501715525179 │
└─────────────────┴────────────────────┴────────────────────┘
┌───────────────────────────────┬────────────────────┬────────────────────┐
│ summary │ current │ prom-client@latest │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#1 with 64 │ 41677.71246850424 │ 39511.557914820645 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 8 │ 16184.068365916142 │ 16323.6542964493 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 4 and 2 with 2 │ 10624.210320088998 │ 10291.462585225858 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 2 and 2 with 4 │ 10180.34915148007 │ 10296.07993677984 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#6 with 2 │ 7881.827572501477 │ 8187.083903455212 │
└───────────────────────────────┴────────────────────┴────────────────────┘
### Summary:
⚠ registry ➭ getMetricsAsJSON#1 with 64 is 3.543% acceptably slower.
⚠ registry ➭ getMetricsAsJSON#2 with 8 is 2.420% acceptably slower.
✓ registry ➭ getMetricsAsJSON#2 with 4 and 2 with 2 is 0.07819% faster.
✓ registry ➭ getMetricsAsJSON#2 with 2 and 2 with 4 is 3.535% faster.
✓ registry ➭ getMetricsAsJSON#6 with 2 is 0.5769% faster.
⚠ registry ➭ metrics#1 with 64 is 9.303% acceptably slower.
✓ registry ➭ metrics#2 with 8 is 0.06552% faster.
✓ registry ➭ metrics#2 with 4 and 2 with 2 is 0.8669% faster.
⚠ registry ➭ metrics#2 with 2 and 2 with 4 is 5.428% acceptably slower.
✓ registry ➭ metrics#6 with 2 is 4.010% faster.
✓ histogram ➭ observe#1 with 64 is 3.261% faster.
⚠ histogram ➭ observe#2 with 8 is 0.1678% acceptably slower.
✓ histogram ➭ observe#2 with 4 and 2 with 2 is 4.507% faster.
✓ histogram ➭ observe#2 with 2 and 2 with 4 is 0.1417% faster.
✓ histogram ➭ observe#6 with 2 is 2.489% faster.
✓ gauge ➭ inc is 8.531% faster.
⚠ gauge ➭ inc with labels is 0.2278% acceptably slower.
✓ summary ➭ observe#1 with 64 is 5.482% faster.
⚠ summary ➭ observe#2 with 8 is 0.8625% acceptably slower.
✓ summary ➭ observe#2 with 4 and 2 with 2 is 3.233% faster.
⚠ summary ➭ observe#2 with 2 and 2 with 4 is 1.137% acceptably slower.
⚠ summary ➭ observe#6 with 2 is 3.873% acceptably slower.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment