mruby-bigint: increase KARATSUBA_THREASHOLD to 512

Since Karatsuba algorithm is far heavier than the basic multiplication,
we have increased KARATSUBA_THREASHOLD and decreased MAX_RECURSION_DEPTH.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-10-03 18:13:43 +09:00
parent 6820da1526
commit 32aed6ad8c
+2 -2
View File
@@ -385,8 +385,8 @@ mul_base(mrb_state *mrb, mpz_t *ww, mpz_t *u, mpz_t *v)
static void mpz_mul_2exp(mrb_state *mrb, mpz_t *z, mpz_t *x, mrb_int e);
/* Thresholds */
#define KARATSUBA_THRESHOLD 32
#define MAX_RECURSION_DEPTH 16
#define KARATSUBA_THRESHOLD 512
#define MAX_RECURSION_DEPTH 10
/* Karatsuba Multiply */
static void