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

moonbitlang / core / 5143
91%

Build:
DEFAULT BRANCH: main
Ran 12 Jul 2026 03:58PM UTC
Jobs 1
Files 382
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

12 Jul 2026 03:57PM UTC coverage: 91.221% (+0.001%) from 91.22%
5143

push

github

web-flow
perf(bigint): build to_string digits in one pass instead of prepending (#3709)

* perf(bigint): build to_string digits in one pass instead of prepending

The base-10 `BigInt::to_string` emitted each decimal digit with
`ret = digit.to_string() + ret`, prepending into a freshly allocated
string on every digit. That is quadratic in the digit count and
allocates a one-char string plus a full copy of the accumulator per
digit.

Emit the digits least-significant-first into a pre-sized
`FixedArray[Char]` and materialize the result string once. The
limb->decimal base-conversion loop above this is a separate O(n^2) cost
and is left untouched; this only removes the quadratic string building
in the digit-emission phase.

Bench (BigInt::to_string, native):
    40 digits:  649.9 ns -> 148.1 ns  (4.4x)
   400 digits:    9.73 µs ->  2.76 µs (3.5x)
  4000 digits:  410.4 µs -> 194.5 µs  (2.1x)

Adds bigint/to_string_bench_test.mbt to cover the path.

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

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* test(bigint): guard make_decimal against non-positive digit counts

Addresses review feedback: make_decimal claimed to produce exactly
`digits` digits but silently misbehaved for digits <= 0 (it still built
"1" and passed a negative size_hint to StringBuilder). Fail loudly on
misuse instead.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

9 of 9 new or added lines in 1 file covered. (100.0%)

15628 of 17132 relevant lines covered (91.22%)

191916.19 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5143.1 12 Jul 2026 03:58PM UTC 383
91.24
GitHub Action Run
Source Files on build 5143
  • Tree
  • List 382
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • b1e75835 on github
  • Prev Build on main (#5140)
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