mruby-bigint: raise Karatsuba threshold from 8 to 32

Reduces recursion overhead for large number multiplication.
Benchmarks show ~32% speedup for million-bit operands.

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Yukihiro "Matz" Matsumoto
2026-01-09 11:36:38 +09:00
parent 0a5ec60e5c
commit df778e09d2
+1 -1
View File
@@ -845,7 +845,7 @@ limb_addmul_1(mp_limb *rp, const mp_limb *s1p, size_t n, mp_limb limb)
#endif
}
#define KARATSUBA_THRESHOLD 8
#define KARATSUBA_THRESHOLD 32
static inline mrb_bool
should_use_karatsuba(size_t x_len, size_t y_len)