• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jeschkies / loki / 7259430073
80%

Build:
DEFAULT BRANCH: main
Ran 19 Dec 2023 08:51AM UTC
Jobs 1
Files 91
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

19 Dec 2023 08:46AM UTC coverage: 80.622% (+0.1%) from 80.507%
7259430073

push

github

web-flow
Optimize series response format by using repeated fileds. (#11498)

**What this PR does / why we need it**:
The Protobuf map type is encodied as a repeated field of map entries.
Decoding them to a slice is much faster than decoding them into a map.
Since Loki is not using the fast key check for a map we can use the
slice decoding.

This change also allows us to decode the JSON directly into the right
protobuf struct. This doulbes the JSON decoding speed and reduces the
memory pressure by ~40%.

```
› go test -bench=. -run=^$ -count=10 ./pkg/querier/queryrange > before.log
› go test -bench=. -run=^$ -count=10 ./pkg/querier/queryrange > after.log
› benchstat before.log after.log
goos: darwin
goarch: arm64
pkg: github.com/grafana/loki/pkg/querier/queryrange
                                                             │  before.log  │              after.log               │
                                                             │    sec/op    │    sec/op     vs base                │
ResponseMerge/mergeStreams_unlimited-10                         32.36m ± 0%   32.63m ±  2%        ~ (p=0.393 n=10)
ResponseMerge/mergeOrderedNonOverlappingStreams_unlimited-10    1.050m ± 1%   1.080m ±  3%   +2.84% (p=0.005 n=10)
ResponseMerge/mergeStreams_limited-10                           33.02m ± 0%   32.60m ±  1%   -1.29% (p=0.004 n=10)
ResponseMerge/mergeOrderedNonOverlappingStreams_limited-10      15.11m ± 0%   15.07m ±  0%        ~ (p=0.075 n=10)
_CodecDecodeLogs-10                                             4.395m ± 1%   4.364m ±  0%   -0.72% (p=0.005 n=10)
_CodecDecodeSamples-10                                          16.97m ± 0%   16.84m ±  2%   -0.77% (p=0.023 n=10)
_CodecDecodeSeries/application/vnd.google.protobuf-10           745.8µ ± 8%   736.8µ ± 12%        ~ (p=0.739 n=10)
_CodecDecodeSeries/application/json;_charset=utf-8-10           15.37m ± 1%   10.60m ±  0%  -31.03% (p=0.000 n=10)
_MergeResponses-10                     ... (continued)

6453 of 8004 relevant lines covered (80.62%)

0.86 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
5
94.19
-0.31% operator/internal/status/lokistack.go
10
51.22
7.82% operator/internal/status/status.go
14
17.33
0.0% operator/controllers/loki/lokistack_controller.go
Jobs
ID Job ID Ran Files Coverage
1 7259430073.1 19 Dec 2023 08:51AM UTC 91
80.62
GitHub Action Run
Source Files on build 7259430073
  • Tree
  • List 91
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 9aae2500 on github
  • Prev Build on main (#7206680174)
  • Next Build on main (#7276740477)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc