Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize LabelValues in metric proto
LabelValues is now a separate message. Benchmarking results are below (Baseline is current `master`, Proposed is after this commit). This change reduces CPU usage by about 18% for one-data-point timeseries encoding and reduces memory consumption by about 7%. ``` ===== Encoded sizes Encoding Uncompressed Improved Compressed Improved Baseline/MetricOne 19150 bytes [1.000], gziped 1600 bytes [1.000] Proposed/MetricOne 18550 bytes [1.032], gziped 1601 bytes [0.999] Encoding Uncompressed Improved Compressed Improved Baseline/MetricSeries 43115 bytes [1.000], gziped 6316 bytes [1.000] Proposed/MetricSeries 42515 bytes [1.014], gziped 6285 bytes [1.005] goos: darwin goarch: amd64 pkg: github.com/tigrannajaryan/exp-otelproto/encodings BenchmarkEncode/Baseline/MetricOne-8 42 125724579 ns/op BenchmarkEncode/Proposed/MetricOne-8 62 102677556 ns/op BenchmarkEncode/Baseline/MetricSeries-8 16 323098665 ns/op BenchmarkEncode/Proposed/MetricSeries-8 19 311684082 ns/op BenchmarkDecode/Baseline/MetricOne-8 21 274958910 ns/op 156696037 B/op 4274000 allocs/op BenchmarkDecode/Proposed/MetricOne-8 24 268134546 ns/op 144696034 B/op 3974000 allocs/op BenchmarkDecode/Baseline/MetricSeries-8 8 648421823 ns/op 339096032 B/op 8374000 allocs/op BenchmarkDecode/Proposed/MetricSeries-8 9 637746497 ns/op 327096035 B/op 8074000 allocs/op ```
- Loading branch information