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

moonbitlang / core / 6222
91%

Build:
DEFAULT BRANCH: main
Ran 20 Aug 2026 07:19AM UTC
Jobs 1
Files 445
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

20 Aug 2026 07:15AM UTC coverage: 90.734% (+0.02%) from 90.718%
6222

push

github

bobzhang
perf(builtin): aligned fast paths for generic bitstring extraction via entry/slow split

Supersedes the approach in #3777 (thanks @mizchi for identifying the
aligned-delegation opportunity and the benchmark workload). That PR
added aligned exact-width guards inline in the eight generic
unsafe_extract_uint{,64}_{le,be} functions; re-benchmarked against
current main this REGRESSED native u32 by 17-26%, because the guards
pushed the large generic bodies past the native inliner's threshold —
calling the aligned helper unconditionally measured 2.3x FASTER than
main, and guard reordering did not help, isolating inlining as the
cause.

This commit uses the shape that keeps inlining: each generic function
becomes a small entry (aligned 32/16-bit — or 64-bit — checks
delegating to the existing *_aligned intrinsic-backed helpers) that
tail-calls the previous byte-by-byte body, outlined into a private
*_slow function. The resolved TODO comments ("add fast path for
aligned case") are dropped.

Benchmarks (moon bench --release, 8192-byte views, XOR-fold loops;
main -> this branch, BytesView cells; ArrayView behaves alike):

  aligned u32:  native 5.01 -> 1.88us (2.7x), js 30.5 -> 2.5-4.6us
                (bimodal V8 tiering; 6-12x), wasm 16.8 -> 8.2us (2.0x),
                wasm-gc 14.5 -> 5.1us (2.8x)
  aligned u64:  native 3.06 -> 0.94us (3.2x), js 111.8 -> 93.3us,
                wasm 13.6 -> 4.1us (3.3x), wasm-gc 12.4 -> 3.8us (3.2x)
  unaligned u32/u64: par on all four backends (within 3%)
  aligned len=16: js 21.2 -> 8.0us, wasm 19.2 -> 16.6us, wasm-gc
                15.2 -> 11.3us; native 0.48 -> 3.76us — main's
                trivially-inlined two-byte path loop-vectorizes in this
                synthetic XOR-fold, which no call-based path can match;
                single-call latency is comparable and every other
                backend improves.
  aligned len=24 (no aligned helper exists): native and wasm-gc par;
                wasm 17.7 -> 23.7us... (continued)

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

16304 of 17969 relevant lines covered (90.73%)

331873.79 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6222.1 20 Aug 2026 07:19AM UTC 446
90.75
GitHub Action Run
Source Files on build 6222
  • Tree
  • List 445
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • d32cdf11 on github
  • Prev Build on main (#6218)
  • Next Build on main (#6223)
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