Skip to content

Instantly share code, notes, and snippets.

@voltbit
Created January 11, 2022 12:02
Show Gist options
  • Save voltbit/70539929453a2b95d4f9ac2df6707a9b to your computer and use it in GitHub Desktop.
Save voltbit/70539929453a2b95d4f9ac2df6707a9b to your computer and use it in GitHub Desktop.
prom-client benchmark 4
❯ node index.js
# Benchmark Regression
## Installing baseline packages
http fetch GET 200 https://registry.npmjs.org/prom-client 1215ms
http fetch GET 200 https://registry.npmjs.org/prom-client/-/prom-client-14.0.1.tgz 52ms
+ prom-client@14.0.1
added 3 packages from 3 contributors and audited 3 packages in 1.43s
found 0 vulnerabilities
## Starting benchmark suite
### Progress:
- registry ➭ getMetricsAsJSON#1 with 64 ➭ current x 2,316 ops/sec ±7.62% (80 runs sampled)
- registry ➭ getMetricsAsJSON#1 with 64 ➭ prom-client@latest x 2,440 ops/sec ±8.67% (73 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 8 ➭ current x 2,005 ops/sec ±5.73% (75 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 8 ➭ prom-client@latest x 2,066 ops/sec ±6.42% (72 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 4 and 2 with 2 ➭ current x 1,689 ops/sec ±6.18% (76 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 4 and 2 with 2 ➭ prom-client@latest x 1,758 ops/sec ±5.27% (78 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 2 and 2 with 4 ➭ current x 1,716 ops/sec ±6.53% (76 runs sampled)
- registry ➭ getMetricsAsJSON#2 with 2 and 2 with 4 ➭ prom-client@latest x 1,714 ops/sec ±5.77% (78 runs sampled)
- registry ➭ getMetricsAsJSON#6 with 2 ➭ current x 1,549 ops/sec ±3.88% (78 runs sampled)
- registry ➭ getMetricsAsJSON#6 with 2 ➭ prom-client@latest x 1,613 ops/sec ±5.23% (79 runs sampled)
- registry ➭ metrics#1 with 64 ➭ current x 2,097 ops/sec ±9.97% (68 runs sampled)
- registry ➭ metrics#1 with 64 ➭ prom-client@latest x 2,338 ops/sec ±7.77% (79 runs sampled)
- registry ➭ metrics#2 with 8 ➭ current x 2,069 ops/sec ±9.76% (71 runs sampled)
- registry ➭ metrics#2 with 8 ➭ prom-client@latest x 2,065 ops/sec ±13.74% (68 runs sampled)
- registry ➭ metrics#2 with 4 and 2 with 2 ➭ current x 1,729 ops/sec ±6.80% (77 runs sampled)
- registry ➭ metrics#2 with 4 and 2 with 2 ➭ prom-client@latest x 1,747 ops/sec ±7.18% (78 runs sampled)
- registry ➭ metrics#2 with 2 and 2 with 4 ➭ current x 1,673 ops/sec ±6.39% (76 runs sampled)
- registry ➭ metrics#2 with 2 and 2 with 4 ➭ prom-client@latest x 1,730 ops/sec ±8.25% (77 runs sampled)
- registry ➭ metrics#6 with 2 ➭ current x 1,364 ops/sec ±5.86% (71 runs sampled)
- registry ➭ metrics#6 with 2 ➭ prom-client@latest x 1,569 ops/sec ±5.22% (72 runs sampled)
- histogram ➭ observe#1 with 64 ➭ current x 47,266 ops/sec ±1.55% (88 runs sampled)
- histogram ➭ observe#1 with 64 ➭ prom-client@latest x 47,396 ops/sec ±1.09% (88 runs sampled)
- histogram ➭ observe#2 with 8 ➭ current x 19,167 ops/sec ±1.13% (86 runs sampled)
- histogram ➭ observe#2 with 8 ➭ prom-client@latest x 19,269 ops/sec ±0.90% (90 runs sampled)
- histogram ➭ observe#2 with 4 and 2 with 2 ➭ current x 12,188 ops/sec ±0.72% (91 runs sampled)
- histogram ➭ observe#2 with 4 and 2 with 2 ➭ prom-client@latest x 12,199 ops/sec ±0.75% (91 runs sampled)
- histogram ➭ observe#2 with 2 and 2 with 4 ➭ current x 11,910 ops/sec ±1.26% (85 runs sampled)
- histogram ➭ observe#2 with 2 and 2 with 4 ➭ prom-client@latest x 11,948 ops/sec ±1.04% (91 runs sampled)
- histogram ➭ observe#6 with 2 ➭ current x 8,720 ops/sec ±1.08% (89 runs sampled)
- histogram ➭ observe#6 with 2 ➭ prom-client@latest x 8,775 ops/sec ±0.93% (89 runs sampled)
- gauge ➭ inc ➭ current x 10,751,020 ops/sec ±1.56% (85 runs sampled)
- gauge ➭ inc ➭ prom-client@latest x 9,191,696 ops/sec ±1.11% (88 runs sampled)
- gauge ➭ inc with labels ➭ current x 11,864 ops/sec ±2.43% (84 runs sampled)
- gauge ➭ inc with labels ➭ prom-client@latest x 12,100 ops/sec ±1.56% (86 runs sampled)
- summary ➭ observe#1 with 64 ➭ current x 42,658 ops/sec ±0.79% (93 runs sampled)
- summary ➭ observe#1 with 64 ➭ prom-client@latest x 43,622 ops/sec ±1.40% (93 runs sampled)
- summary ➭ observe#2 with 8 ➭ current x 18,495 ops/sec ±0.92% (87 runs sampled)
- summary ➭ observe#2 with 8 ➭ prom-client@latest x 18,103 ops/sec ±0.85% (90 runs sampled)
- summary ➭ observe#2 with 4 and 2 with 2 ➭ current x 10,613 ops/sec ±2.52% (81 runs sampled)
- summary ➭ observe#2 with 4 and 2 with 2 ➭ prom-client@latest x 10,565 ops/sec ±1.80% (78 runs sampled)
- summary ➭ observe#2 with 2 and 2 with 4 ➭ current x 10,781 ops/sec ±1.91% (84 runs sampled)
- summary ➭ observe#2 with 2 and 2 with 4 ➭ prom-client@latest x 10,933 ops/sec ±1.35% (85 runs sampled)
- summary ➭ observe#6 with 2 ➭ current x 8,371 ops/sec ±1.45% (89 runs sampled)
- summary ➭ observe#6 with 2 ➭ prom-client@latest x 8,465 ops/sec ±1.45% (91 runs sampled)
### Results:
┌────────────────────────────────────────┬────────────────────┬────────────────────┐
│ registry │ current │ prom-client@latest │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#1 with 64 │ 2315.917427696201 │ 2439.709056378323 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#2 with 8 │ 2004.7737104424189 │ 2066.445862443033 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#2 with 4 and 2 with 2 │ 1689.12478021453 │ 1757.750591781068 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#2 with 2 and 2 with 4 │ 1716.1333971350966 │ 1713.6180791827544 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ getMetricsAsJSON#6 with 2 │ 1549.2528260014094 │ 1613.3449061902745 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#1 with 64 │ 2096.8671205656747 │ 2338.0878866948856 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#2 with 8 │ 2069.329130953445 │ 2064.840654142084 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#2 with 4 and 2 with 2 │ 1728.6516682031304 │ 1746.7375476332984 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#2 with 2 and 2 with 4 │ 1673.070367467058 │ 1730.1767631739463 │
├────────────────────────────────────────┼────────────────────┼────────────────────┤
│ metrics#6 with 2 │ 1364.1057339912556 │ 1569.152459830118 │
└────────────────────────────────────────┴────────────────────┴────────────────────┘
┌───────────────────────────────┬────────────────────┬────────────────────┐
│ histogram │ current │ prom-client@latest │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#1 with 64 │ 47266.478978870524 │ 47395.76712161461 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 8 │ 19166.7387255918 │ 19268.80214944132 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 4 and 2 with 2 │ 12188.1351130286 │ 12199.210352982955 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 2 and 2 with 4 │ 11909.753194644209 │ 11948.382017020263 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#6 with 2 │ 8719.6458413528 │ 8774.595325003063 │
└───────────────────────────────┴────────────────────┴────────────────────┘
┌─────────────────┬───────────────────┬────────────────────┐
│ gauge │ current │ prom-client@latest │
├─────────────────┼───────────────────┼────────────────────┤
│ inc │ 10751020.12160021 │ 9191695.6200023 │
├─────────────────┼───────────────────┼────────────────────┤
│ inc with labels │ 11864.25236011933 │ 12100.435701484097 │
└─────────────────┴───────────────────┴────────────────────┘
┌───────────────────────────────┬────────────────────┬────────────────────┐
│ summary │ current │ prom-client@latest │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#1 with 64 │ 42657.66122646683 │ 43622.13643424025 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 8 │ 18495.3064519947 │ 18103.249030115334 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 4 and 2 with 2 │ 10613.44038752526 │ 10565.344431332365 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#2 with 2 and 2 with 4 │ 10780.954165170273 │ 10932.590408502401 │
├───────────────────────────────┼────────────────────┼────────────────────┤
│ observe#6 with 2 │ 8371.271726331193 │ 8464.69922352185 │
└───────────────────────────────┴────────────────────┴────────────────────┘
### Summary:
⚠ registry ➭ getMetricsAsJSON#1 with 64 is 5.345% acceptably slower.
⚠ registry ➭ getMetricsAsJSON#2 with 8 is 3.076% acceptably slower.
⚠ registry ➭ getMetricsAsJSON#2 with 4 and 2 with 2 is 4.063% acceptably slower.
✓ registry ➭ getMetricsAsJSON#2 with 2 and 2 with 4 is 0.1468% faster.
⚠ registry ➭ getMetricsAsJSON#6 with 2 is 4.137% acceptably slower.
✗ registry ➭ metrics#1 with 64 is 11.50% slower.
✓ registry ➭ metrics#2 with 8 is 0.2174% faster.
⚠ registry ➭ metrics#2 with 4 and 2 with 2 is 1.046% acceptably slower.
⚠ registry ➭ metrics#2 with 2 and 2 with 4 is 3.413% acceptably slower.
✗ registry ➭ metrics#6 with 2 is 15.03% slower.
⚠ histogram ➭ observe#1 with 64 is 0.2735% acceptably slower.
⚠ histogram ➭ observe#2 with 8 is 0.5325% acceptably slower.
⚠ histogram ➭ observe#2 with 4 and 2 with 2 is 0.09087% acceptably slower.
⚠ histogram ➭ observe#2 with 2 and 2 with 4 is 0.3243% acceptably slower.
⚠ histogram ➭ observe#6 with 2 is 0.6302% acceptably slower.
✓ gauge ➭ inc is 16.96% faster.
⚠ gauge ➭ inc with labels is 1.991% acceptably slower.
⚠ summary ➭ observe#1 with 64 is 2.261% acceptably slower.
✓ summary ➭ observe#2 with 8 is 2.166% faster.
✓ summary ➭ observe#2 with 4 and 2 with 2 is 0.4552% faster.
⚠ summary ➭ observe#2 with 2 and 2 with 4 is 1.407% acceptably slower.
⚠ summary ➭ observe#6 with 2 is 1.116% acceptably slower.
⚠ Benchmarks failed to perform better than the currently published version.
- Please determine if the performance changes are expected and acceptable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment