mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
0220ec2b62
When multiplying numbers where one is significantly larger than the other (at least 2x size difference), split the larger number into chunks matching the smaller number's size, multiply each chunk, and combine results. This avoids pathological performance when Toom-3 pads asymmetric operands with zeros. Benchmarks show 6-16x speedup for size ratios from 10:1 to 40:1, with no regression for symmetric cases. Co-authored-by: Claude <noreply@anthropic.com>