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

moonbitlang / core / 3911
95%

Build:
DEFAULT BRANCH: main
Ran 24 Apr 2026 01:54AM UTC
Jobs 1
Files 356
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 Apr 2026 01:53AM UTC coverage: 94.87% (-0.001%) from 94.871%
3911

push

github

bobzhang
perf(argparse): thread ArrayView[String] through subcommand dispatch

Four `.to_owned()` calls in the parser hot path were eagerly
materializing an `Array[String]` from what downstream consumers accept
as `ArrayView[String]`:

- `default_argv()` returns the initial argv slice — `Command::parse`
  already declares its `argv?` parameter as `ArrayView[String]`.
- `parser.mbt` built two `rest` arrays (the help-subcommand path and
  the generic-subcommand dispatch path) only to pass them to
  `parse_command`, which also takes `ArrayView[String]`.
- `parser_lookup.mbt::split_long` was calling `to_owned()` on
  `ArrayView[StringView]` just to invoke `.join("=")`, which works
  directly on the view.

Returning / passing views saves one `Array` allocation per call. On a
program with nested subcommands, the dispatch path takes several of
these per invocation. `resolve_help_target` only needs pattern-match
and iteration over `argv`, which work on `ArrayView[String]` — changed
the private-signature's parameter type accordingly.

No mbti change: `default_argv` and `resolve_help_target` are private
`fn`s, and `parse_command` already accepted `ArrayView[String]`.

1 of 2 new or added lines in 2 files covered. (50.0%)

14721 of 15517 relevant lines covered (94.87%)

221128.78 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
79.13
-0.2% argparse/parser.mbt
Jobs
ID Job ID Ran Files Coverage
1 3911.1 24 Apr 2026 01:54AM UTC 357
94.88
GitHub Action Run
Source Files on build 3911
  • Tree
  • List 356
  • Changed 2
  • Source Changed 2
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 55a95d60 on github
  • Prev Build on main (#3907)
  • Next Build on main (#3913)
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