dzmingli_vs_floating performance

Measurement environment

The numbers come from one native release run on an Apple M4 under macOS 26.5 with moon 0.1.20260703, DzmingLi/decimal@0.2.2, Luna-Flow/floating@0.7.1 and Luna-Flow/mare_mark@0.3.0, recorded on 2026-07-15. CPU frequency was not controlled. The MoonBit 0.10 migration on this branch changes no benchmark logic and the run has not been repeated with the new toolchain. The measurement method is derived on the design page.

Results

The current 0.7.1 run contains 1,476 scaling validations, with 1,368 passes and 108 DzmingLi failures. The expanded common-digit run contains 1,368/1,368 successful validations for 19 operations.

At 1,024 digits, where both implementations still pass the oracle, floating GDA records 0.978–16.798 µs/op for the five arithmetic-only operations versus DzmingLi’s 12.459–78.978 µs/op. Full-path medians are 7.427–24.133 µs/op versus 152.145–205.549 µs/op. The resulting GDA speedup ranges from 3.54× for arithmetic-only multiplication to 95.44× for arithmetic-only comparison.

DzmingLi arithmetic is incorrect from 4,096 digits, so those points are not speedups. At 20,000 digits the validated GDA medians are 14.810 µs add, 15.083 µs subtract, 60.588 µs divide, and 0.130 µs compare for arithmetic-only; full-path medians are 154.468, 155.582, 131.363, and 139.865 µs, respectively.

Data-dependent comparison

DzmingLi’s arithmetic-only comparison curve remains data-dependent at large input sizes: its medians at 4,096, 8,192, 10,000, 16,384, and 20,000 digits are 105.918, 0.103, 675.705, 0.101, and 2,203.063 µs/op. Some fixtures can be ordered immediately from sign, exponent, or significant-digit metadata, while others require a deep coefficient comparison. The connected curve therefore contains execution-class spikes rather than a single digit-count scaling law. Full-path timing also includes parsing and construction costs; comparison should be evaluated by input class as well as coefficient size.

Data and figures

The figures and reports for this analysis are kept in the repository: the main figure, the supplementary figure, the scaling report and the common-digit report, with the JSONL records and the Plot IR beside them.