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

floatdrop / zoxy / 28705491749

04 Jul 2026 11:58AM UTC coverage: 96.709% (-0.002%) from 96.711%
28705491749

push

github

floatdrop
metrics: shard counters per worker — no shared cache line on the data path

Metrics was one struct of ~24 contiguous u64 atomics RMW'd by every
worker: eight counters per 64-byte line, the adjacent bytes_to_* pair hit
once per 16 KiB relay chunk from every core at once, and worker_accepted
packed eight workers' counters into each line (pure false sharing).

Now each worker writes only its own Counters shard, padded to
std.atomic.cache_line (128 on x86_64 — the L2 spatial prefetcher pulls
adjacent line pairs). Single writer per shard: the RMW stays uncontended
and the line stays in that core's cache. Readers off the data path (admin
scrape, handoff snapshot, drain check) sum across shards via
Metrics.total. ProxyServer/ProxyConn/HealthChecker hold a *Counters.

The per-worker accept series now falls out of the shards, so the
worker_accepted array and ProxyServer.worker_index are gone (the series
counts started connections; it previously also counted pool-full
rejections). Hot-restart totals fold into a dedicated adopted shard so a
predecessor's counters never pollute a worker's accept series.

Gate: 148/148 tests, sim seeds 0..500 OK. zrk A/B vs HEAD (R=30k, c=64,
3 alternating ReleaseFast runs): bands overlap exactly — p50 152-177µs
both binaries, ~29.9k req/s both. No loopback cost; the win is coherence
traffic as core count and body sizes grow.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

7052 of 7292 relevant lines covered (96.71%)

0.97 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.15
src/obs/admin.zig


Source Not Available

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