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

Logflare / logflare / 267d4b2d4d5163af858992d1831d73a394e61a32
82%

Build:
DEFAULT BRANCH: main
Ran 30 Jun 2026 11:33PM UTC
Jobs 1
Files 488
Run time 1min
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

30 Jun 2026 11:18PM UTC coverage: 81.772% (-0.02%) from 81.794%
267d4b2d4d5163af858992d1831d73a394e61a32

push

github

web-flow
perf(clickhouse): reduce allocations in RowBinary row encoding (#3630)

* perf(clickhouse): reduce allocations in RowBinary row encoding

Three low-risk optimizations to the ClickHouse RowBinary encoder hot path:

- Hoist the batch-constant mapping_config_id UUID encode out of the
  per-row loop in encode_batch/2 -- it is identical for every row in a
  batch, so encode it once and reuse the bytes.
- Add a binary-pattern-match fast path to RowBinaryEncoder.uuid/1 for
  canonical hyphenated UUIDs, avoiding the String.replace intermediate.
- Encode String->String maps with :maps.fold instead of
  Map.to_list + length + Enum.flat_map, dropping a list materialization,
  an O(n) length walk, and the unnecessary flatten.

Output is byte-identical; existing encoder and ingester tests pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* test(clickhouse): add benchmarks for RowBinary encoding optimizations

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* perf(clickhouse): specialize map_string_string encoding

map_string_string is the hottest map encoder in the ClickHouse RowBinary
path -- it encodes every resource/scope/log/span attribute map, plus the
per-event attribute maps nested inside metric exemplars and trace
events/links. It previously delegated to the generic map/3, which wraps
each key and value in string/1's intermediate [varint, bytes] list.

Encode the map directly with :maps.fold, inlining the length-prefix for
binary keys and values so each pair emits a single flat iolist fragment
instead of two nested ones. A guarded fallback clause preserves the
existing behavior for non-binary (iodata-list) values, so output stays
byte-identical and the map iteration order is unchanged (:maps.fold, as
before).

Micro-benchmarks (memory/op, baseline -> specialized):
  3-key map:    664 B  -> 568 B   (-14%)
  15-key map:  2.43 KB -> 1.96 KB (-19%)
  100-key map: 18.9 KB -> 15.7 KB (-17%)

Existing encoder and i... (continued)

15 of 16 new or added lines in 2 files covered. (93.75%)

5 existing lines in 1 file now uncovered.

13552 of 16573 relevant lines covered (81.77%)

5181.16 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
98.92
-1.08% lib/logflare/backends/adaptor/clickhouse_adaptor/row_binary_encoder.ex

Coverage Regressions

Lines Coverage ∆ File
5
66.67
-20.83% lib/logflare/backends/consolidated_sup_worker.ex
Jobs
ID Job ID Ran Files Coverage
1 267d4b2d4d5163af858992d1831d73a394e61a32.1 30 Jun 2026 11:33PM UTC 488
81.77
GitHub Action Run
Source Files on build 267d4b2d4d5163af858992d1831d73a394e61a32
  • Tree
  • List 488
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 267d4b2d on github
  • Prev Build on main (#8BF23D5F...)
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

© 2026 Coveralls, Inc