Skip to content

perf: decode common BCD fields with integer arithmetic - #152

Merged
maebli merged 1 commit into
mainfrom
perf/bcd-integer-accumulation
Sep 27, 2026
Merged

maebli merged 1 commit into
mainfrom
perf/bcd-integer-accumulation

Conversation

@maebli

@maebli maebli commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Common BCD fields now accumulate two digits at a time in u64 and convert to f64 once. Byte-aligned values through 14 digits use this path; longer values retain the original floating-point accumulation and rounding. Sign markers, byte ordering, invalid-digit errors, and positive zero are preserved.

Adds focused Criterion cases and differential coverage against the original floating-point decoder, including all 65,536 two-byte encodings and sampled values through 18 digits.

Validation:

  • Application-layer tests with all features and root cargo test --all-features pass.
  • Library Clippy, application-layer all-target Clippy, formatting, and the thumbv7m-none-eabi no_std build pass.
  • Root all-target Clippy is blocked by existing warnings in unrelated annotation/integration tests.

Native Criterion comparison on this aarch64 Mac (opt-level=z, 30 samples, 1s warm-up, 2s measurement): 2/8/12-digit cases improved about 5%/30%/37%. Full-frame decode had no statistically detected change. The unchanged 18-digit arithmetic path measured about 5% slower, with the unrelated frame-only control also about 4% slower; native timing remains noisy. These are not MCU cycle measurements; embedded stack/flash impact remains for CI resource checks.

@maebli
maebli merged commit adbd001 into main Sep 27, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant