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

dnsimple / dns_erlang / 30098895286
92%

Build:
DEFAULT BRANCH: main
Ran 24 Jul 2026 01:56PM UTC
Jobs 1
Files 12
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

24 Jul 2026 01:56PM UTC coverage: 88.453% (+0.1%) from 88.337%
30098895286

push

github

web-flow
Optimize dns_domain:to_wire/3 name encoding (#133)

The compressed name encoder previously split every name twice: once raw,
and once after lowering a full copy of the name for the compression-map
keys. Since to_lower/1 is a strict byte-for-byte map that never touches
'.' or '\' (and never produces them), label offsets are case-invariant
and the second split was redundant. The encoder now:

- splits the name once; for names without backslashes (the common
  case) labels are zero-copy sub-binaries produced by binary:split/3,
  with a trailing dot trimmed up front so no trailing-empty handling
  is needed (compiled patterns are cached in a persistent_term);
- skips lowering entirely when the name is already lowercase, reusing
  the labels list itself as the compression-map keys (zero extra
  allocation);
- for mixed-case names (0x20-randomized qnames), lowers the trimmed
  name once and re-splits it, which is guaranteed to reproduce the
  structure of the already-validated labels;
- falls back to the copying do_split/2 for names containing escape
  sequences;
- defers compression-map suffix inserts and applies them in one batch
  on exit. Suffix keys of the name being encoded can never be looked
  up while encoding that same name, so this is observably identical,
  while avoiding one map copy per label and the term-ordered key
  comparisons that incremental flatmap inserts perform against
  deep-sharing suffix-list keys (the source of a pathological slowdown
  on many-label names such as IPv6 reverse PTRs).

Behavior is unchanged, including raised error terms and the historical
leading-empty-label quirk (".foo"). This was verified by a parity
harness comparing old and new implementations across 31 names
(case-randomized, escaped, FQDN, over-long, contiguous-dot, >255-octet)
x 5 compression-map states (cold, warm, Pos >= 2^14, stale pointers),
matching both return values and raised exceptions, run on both machines
below. make test (lint, xref, dialyzer, ... (continued)

52 of 53 new or added lines in 1 file covered. (98.11%)

1 existing line in 1 file now uncovered.

2796 of 3161 relevant lines covered (88.45%)

10970.45 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
97.87
-0.1% src/dns_domain.erl

Coverage Regressions

Lines Coverage ∆ File
1
97.87
-0.1% src/dns_domain.erl
Jobs
ID Job ID Ran Files Coverage
1 30098895286.1 24 Jul 2026 01:56PM UTC 12
88.45
GitHub Action Run
Source Files on build 30098895286
  • Tree
  • List 12
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #30098895286
  • 41dcc994 on github
  • Prev Build on main (#30097303416)
  • Next Build on main (#30105223823)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc