mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-05-17 08:36:55 +03:00
This increases the parser performance by 4x-6x. This commit uses the technique similar to https://github.com/VictoriaMetrics/VictoriaLogs/pull/720 goos: linux goarch: amd64 pkg: github.com/VictoriaMetrics/VictoriaMetrics/lib/protoparser/opentelemetry/stream cpu: AMD Ryzen 7 PRO 5850U with Radeon Graphics │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ ParseStream/default-metrics-labels-formatting-16 15.565µ ± 1% 2.150µ ± 3% -86.19% (p=0.000 n=10) ParseStream/prometheus-metrics-labels-formatting-16 24.228µ ± 2% 4.355µ ± 1% -82.02% (p=0.000 n=10) ParseStream/prometheus-metrics-formatting-16 23.028µ ± 2% 3.395µ ± 1% -85.26% (p=0.000 n=10) geomean 20.55µ 3.168µ -84.59% │ old.txt │ new.txt │ │ B/s │ B/s vs base │ ParseStream/default-metrics-labels-formatting-16 127.9Mi ± 1% 918.3Mi ± 3% +617.82% (p=0.000 n=10) ParseStream/prometheus-metrics-labels-formatting-16 82.19Mi ± 2% 453.32Mi ± 1% +451.57% (p=0.000 n=10) ParseStream/prometheus-metrics-formatting-16 86.47Mi ± 2% 581.56Mi ± 1% +572.52% (p=0.000 n=10) geomean 96.88Mi 623.3Mi +543.34% │ old.txt │ new.txt │ │ B/op │ B/op vs base │ ParseStream/default-metrics-labels-formatting-16 12.53Ki ± 0% 0.00Ki ± 0% -100.00% (p=0.000 n=10) ParseStream/prometheus-metrics-labels-formatting-16 21.15Ki ± 1% 0.00Ki ± ? -100.00% (p=0.000 n=10) ParseStream/prometheus-metrics-formatting-16 20.74Ki ± 1% 0.00Ki ± ? -100.00% (p=0.000 n=10) geomean 17.65Ki ? ¹ ² ¹ summaries must be >0 to compute geomean ² ratios must be >0 to compute geomean │ old.txt │ new.txt │ │ allocs/op │ allocs/op vs base │ ParseStream/default-metrics-labels-formatting-16 426.0 ± 0% 0.0 ± 0% -100.00% (p=0.000 n=10) ParseStream/prometheus-metrics-labels-formatting-16 514.0 ± 0% 0.0 ± 0% -100.00% (p=0.000 n=10) ParseStream/prometheus-metrics-formatting-16 514.0 ± 0% 0.0 ± 0% -100.00% (p=0.000 n=10) geomean 482.8 ? ¹ ²