Commit fd343a2
authored
perf: update otel benchmark dependencies, add otel bound instrument scenarios (#2451)
Updating benchmarks after substantial efforts to improve otel
performance under contention. Changes:
- Add scenarios for experimental bound instruments. I understand if you
want to reject this until stable.
- Disable exemplars for apples to apples comparison. My understanding is
that the prom client_java cases don't have exemplars enabled, can change
if I'm wrong.
- Update to opentelemetry-java v1.66.0. If we wait until
opentelemetry-java-instrumentation version is released which bundles the
v1.66.0 version, the clutter in pom.xml goes away.
Benchmark results on my machine:
```
Benchmark Mode Cnt Score Error Units
CounterBenchmark.codahaleIncNoLabels thrpt 25 95236.680 ± 755.718 ops/s
CounterBenchmark.openTelemetryAdd thrpt 25 54598.238 ± 290.633 ops/s
CounterBenchmark.openTelemetryBoundAdd thrpt 25 82770.849 ± 342.576 ops/s
CounterBenchmark.openTelemetryBoundInc thrpt 25 85165.317 ± 7.693 ops/s
CounterBenchmark.openTelemetryInc thrpt 25 75136.160 ± 552.123 ops/s
CounterBenchmark.openTelemetryIncNoLabels thrpt 25 85517.108 ± 538.105 ops/s
CounterBenchmark.prometheusAdd thrpt 25 84533.092 ± 680.646 ops/s
CounterBenchmark.prometheusInc thrpt 25 85135.753 ± 23.184 ops/s
CounterBenchmark.prometheusNoLabelsInc thrpt 25 85061.556 ± 194.011 ops/s
CounterBenchmark.simpleclientAdd thrpt 25 9174.173 ± 1542.709 ops/s
CounterBenchmark.simpleclientInc thrpt 25 8860.946 ± 1306.154 ops/s
CounterBenchmark.simpleclientNoLabelsInc thrpt 25 17502.624 ± 830.879 ops/s
HistogramBenchmark.openTelemetryBoundClassic thrpt 25 25261.802 ± 6559.742 ops/s
HistogramBenchmark.openTelemetryBoundExponential thrpt 25 2367.637 ± 381.165 ops/s
HistogramBenchmark.openTelemetryClassic thrpt 25 28697.261 ± 4082.434 ops/s
HistogramBenchmark.openTelemetryExponential thrpt 25 1868.494 ± 101.732 ops/s
HistogramBenchmark.prometheusClassic thrpt 25 23600.746 ± 7292.571 ops/s
HistogramBenchmark.prometheusClassicPerThread thrpt 25 58674.695 ± 98.620 ops/s
HistogramBenchmark.prometheusClassicSingleThread thrpt 25 14865.898 ± 12.295 ops/s
HistogramBenchmark.prometheusNative thrpt 25 10726.819 ± 677.244 ops/s
HistogramBenchmark.simpleclient thrpt 25 17340.988 ± 266.176 ops/s
```
The
[improvements](open-telemetry/opentelemetry-java#8717)
to otel explicit histogram performance came from a design inspired by
prometheus client_java. The code contains attribution. I did manage to
slightly improve on the design - If you agree, I'm happy to chat about
it and encourage prom client_java to copy any of the bits you think are
helpful.
---------
Signed-off-by: Jack Berg <34418638+jack-berg@users.noreply.github.com>1 parent 6d60a5b commit fd343a2
3 files changed
Lines changed: 204 additions & 1 deletion
File tree
- benchmarks
- src/main/java/io/prometheus/metrics/benchmarks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
28 | 47 | | |
29 | 48 | | |
30 | 49 | | |
| |||
73 | 92 | | |
74 | 93 | | |
75 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
76 | 99 | | |
77 | 100 | | |
78 | 101 | | |
| |||
Lines changed: 64 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
6 | 10 | | |
7 | 11 | | |
8 | 12 | | |
9 | 13 | | |
| 14 | + | |
10 | 15 | | |
11 | 16 | | |
12 | 17 | | |
| |||
136 | 141 | | |
137 | 142 | | |
138 | 143 | | |
| 144 | + | |
139 | 145 | | |
140 | 146 | | |
141 | 147 | | |
| |||
153 | 159 | | |
154 | 160 | | |
155 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
156 | 201 | | |
157 | 202 | | |
158 | 203 | | |
| |||
198 | 243 | | |
199 | 244 | | |
200 | 245 | | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
201 | 265 | | |
202 | 266 | | |
203 | 267 | | |
| |||
Lines changed: 117 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
4 | 8 | | |
5 | 9 | | |
6 | 10 | | |
| 11 | + | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
| |||
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| 96 | + | |
91 | 97 | | |
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
95 | 101 | | |
96 | 102 | | |
97 | 103 | | |
| 104 | + | |
98 | 105 | | |
99 | 106 | | |
100 | 107 | | |
| |||
112 | 119 | | |
113 | 120 | | |
114 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
115 | 126 | | |
116 | 127 | | |
117 | 128 | | |
118 | 129 | | |
119 | 130 | | |
120 | 131 | | |
121 | 132 | | |
| 133 | + | |
122 | 134 | | |
123 | 135 | | |
124 | 136 | | |
125 | 137 | | |
126 | 138 | | |
127 | 139 | | |
128 | 140 | | |
| 141 | + | |
129 | 142 | | |
130 | 143 | | |
131 | 144 | | |
| |||
140 | 153 | | |
141 | 154 | | |
142 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
143 | 239 | | |
144 | 240 | | |
145 | 241 | | |
| |||
198 | 294 | | |
199 | 295 | | |
200 | 296 | | |
201 | | - | |
| 297 | + | |
202 | 298 | | |
203 | 299 | | |
204 | 300 | | |
| |||
207 | 303 | | |
208 | 304 | | |
209 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
210 | 326 | | |
211 | 327 | | |
212 | 328 | | |
| |||
0 commit comments