Skip to content

Commit 3db6a08

Browse files
committed
chore: update benchmark results and flush output during runs
Update benchmark numbers after latest run. Notable improvement: prometheusClassic histogram throughput doubled from ~7k to ~15.4k ops/s. Also add flush=True to benchmark script print for real-time output. Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
1 parent 9862869 commit 3db6a08

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

.mise/tasks/update_benchmarks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def run_cmd(cmd: List[str], cwd: Optional[str] = None) -> str:
5353
# Stream lines as they appear and capture them for returning
5454
for line in proc.stdout:
5555
# Print immediately so callers (and CI) can observe progress
56-
print(line, end="")
56+
print(line, end="", flush=True)
5757
output_lines.append(line)
5858
proc.wait()
5959
except KeyboardInterrupt:

benchmarks/src/main/java/io/prometheus/metrics/benchmarks/CounterBenchmark.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@
2222
*
2323
* <pre>
2424
* Benchmark Mode Cnt Score Error Units
25-
* CounterBenchmark.codahaleIncNoLabels thrpt 25 144632.191 ± 2778.333 ops/s
26-
* CounterBenchmark.openTelemetryAdd thrpt 25 2165.775 ± 168.554 ops/s
27-
* CounterBenchmark.openTelemetryInc thrpt 25 1940.143 ± 86.223 ops/s
28-
* CounterBenchmark.openTelemetryIncNoLabels thrpt 25 1880.089 ± 192.395 ops/s
29-
* CounterBenchmark.prometheusAdd thrpt 25 122427.789 ± 1377.485 ops/s
30-
* CounterBenchmark.prometheusInc thrpt 25 183603.131 ± 2812.874 ops/s
31-
* CounterBenchmark.prometheusNoLabelsInc thrpt 25 169733.499 ± 670.495 ops/s
32-
* CounterBenchmark.simpleclientAdd thrpt 25 13771.151 ± 77.473 ops/s
33-
* CounterBenchmark.simpleclientInc thrpt 25 14255.342 ± 117.339 ops/s
34-
* CounterBenchmark.simpleclientNoLabelsInc thrpt 25 14175.465 ± 56.575 ops/s
25+
* CounterBenchmark.codahaleIncNoLabels thrpt 25 141585.607 ± 4512.937 ops/s
26+
* CounterBenchmark.openTelemetryAdd thrpt 25 1734.254 ± 93.992 ops/s
27+
* CounterBenchmark.openTelemetryInc thrpt 25 1824.626 ± 119.822 ops/s
28+
* CounterBenchmark.openTelemetryIncNoLabels thrpt 25 1875.878 ± 130.215 ops/s
29+
* CounterBenchmark.prometheusAdd thrpt 25 121522.492 ± 1724.943 ops/s
30+
* CounterBenchmark.prometheusInc thrpt 25 180139.585 ± 3367.156 ops/s
31+
* CounterBenchmark.prometheusNoLabelsInc thrpt 25 166823.346 ± 2915.374 ops/s
32+
* CounterBenchmark.simpleclientAdd thrpt 25 13040.009 ± 217.831 ops/s
33+
* CounterBenchmark.simpleclientInc thrpt 25 14268.840 ± 127.324 ops/s
34+
* CounterBenchmark.simpleclientNoLabelsInc thrpt 25 13804.127 ± 163.815 ops/s
3535
* </pre>
3636
*
3737
* Prometheus counters are faster than counters of other libraries. For example, incrementing a

benchmarks/src/main/java/io/prometheus/metrics/benchmarks/HistogramBenchmark.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
*
2222
* <pre>
2323
* Benchmark Mode Cnt Score Error Units
24-
* HistogramBenchmark.openTelemetryClassic thrpt 25 968.178 ± 28.582 ops/s
25-
* HistogramBenchmark.openTelemetryExponential thrpt 25 836.000 ± 17.709 ops/s
26-
* HistogramBenchmark.prometheusClassic thrpt 25 7010.393 ± 683.782 ops/s
27-
* HistogramBenchmark.prometheusNative thrpt 25 5040.572 ± 284.433 ops/s
28-
* HistogramBenchmark.simpleclient thrpt 25 10485.462 ± 41.265 ops/s
24+
* HistogramBenchmark.openTelemetryClassic thrpt 25 966.937 ± 46.984 ops/s
25+
* HistogramBenchmark.openTelemetryExponential thrpt 25 816.254 ± 28.033 ops/s
26+
* HistogramBenchmark.prometheusClassic thrpt 25 15468.490 ± 828.441 ops/s
27+
* HistogramBenchmark.prometheusNative thrpt 25 7452.050 ± 282.636 ops/s
28+
* HistogramBenchmark.simpleclient thrpt 25 10082.382 ± 245.428 ops/s
2929
* </pre>
3030
*
3131
* The simpleclient (i.e. client_java version 0.16.0 and older) histograms perform about the same as

benchmarks/src/main/java/io/prometheus/metrics/benchmarks/TextFormatUtilBenchmark.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
*
2525
* <pre>
2626
* Benchmark Mode Cnt Score Error Units
27-
* TextFormatUtilBenchmark.openMetricsWriteToByteArray thrpt 25 826847.708 ± 10941.611 ops/s
28-
* TextFormatUtilBenchmark.openMetricsWriteToNull thrpt 25 847756.101 ± 5299.128 ops/s
29-
* TextFormatUtilBenchmark.prometheusWriteToByteArray thrpt 25 874804.601 ± 9730.060 ops/s
30-
* TextFormatUtilBenchmark.prometheusWriteToNull thrpt 25 910782.719 ± 17617.167 ops/s
27+
* TextFormatUtilBenchmark.openMetricsWriteToByteArray thrpt 25 748557.302 ± 22925.735 ops/s
28+
* TextFormatUtilBenchmark.openMetricsWriteToNull thrpt 25 727876.401 ± 31520.283 ops/s
29+
* TextFormatUtilBenchmark.prometheusWriteToByteArray thrpt 25 768419.214 ± 22785.134 ops/s
30+
* TextFormatUtilBenchmark.prometheusWriteToNull thrpt 25 796486.637 ± 11456.297 ops/s
3131
* </pre>
3232
*/
3333
public class TextFormatUtilBenchmark {

0 commit comments

Comments
 (0)