mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user