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

moonbitlang / core / 3907

24 Apr 2026 01:38AM UTC coverage: 94.871%. Remained the same
3907

push

github

bobzhang
perf(debug): avoid per-element allocation in compact_lines

The bracket/brace/paren branches of `compact_lines` were calling
`to_owned()` on every `trim()` result and every `strip_prefix`/
`strip_suffix` result, then joining with `+` / `join`. For an N-element
group that's roughly N+5 allocations per call, and `compact_lines` is
invoked recursively on every debug print.

Keep substrings as `StringView` until the final `join` / interpolation,
so each branch produces a constant ~2 allocations regardless of N.
Behavior and public surface are unchanged; `debug/pkg.generated.mbti`
is not touched.

All call sites were found by `rg '\.to_owned\(\)' debug/printer.mbt` —
the audit workflow the `to_owned` rename was designed to enable.

16 of 20 new or added lines in 1 file covered. (80.0%)

14723 of 15519 relevant lines covered (94.87%)

221100.28 hits per line

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

90.32
/debug/printer.mbt


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