summaryrefslogtreecommitdiff
path: root/bench
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-03-17 01:26:17 -0700
committerOri Bernstein <ori@eigenstate.org>2018-03-17 01:29:58 -0700
commitf127b8250ecbd5f44622f9bf620af933f7102e78 (patch)
tree0c88b717a00971c7533b7912f4c6f9b5b4afef41 /bench
parentdc9fbed2061a1c5b6de5ce1627aee10c189d123f (diff)
downloadmc-f127b8250ecbd5f44622f9bf620af933f7102e78.tar.gz
Implement karatsuba multiplication.
This is a nice optimization. In the most optimal case, it makes this stupid benchmark about 10 times faster: a = std.mkbigint(17193) b = std.mkbigint(1091327) for var i = 0; i < 12; i++ mul(a, b) mul(b, a) ;; It also makes a decent change (about 10%) on `mbld bench` for bigfactorial, in spite of us mostly not falling into the karatsuba case.
Diffstat (limited to 'bench')
-rw-r--r--bench/bigfactorial.myr1
1 files changed, 1 insertions, 0 deletions
diff --git a/bench/bigfactorial.myr b/bench/bigfactorial.myr
index cbaab6c..a893867 100644
--- a/bench/bigfactorial.myr
+++ b/bench/bigfactorial.myr
@@ -7,6 +7,7 @@ const main = {
[.name="bigfactorial-100", .fn={ctx; bigfact(100)}],
[.name="bigfactorial-1000", .fn={ctx; bigfact(1000)}],
[.name="bigfactorial-10000", .fn={ctx; bigfact(10000)}],
+ [.name="bigfactorial-20000", .fn={ctx; bigfact(20000)}],
][:])
}