From 6a135a0894fff5bbb1885c27fd9eb41b9a2b4e51 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 12 Jul 2012 14:19:09 -0700 Subject: [PATCH] mat/big: more optimal Karatsuba threshold benchmark old ns/op new ns/op delta BenchmarkHilbert 6253043 6267289 +0.23% BenchmarkMul 45355940 39490633 -12.93% R=r CC=golang-dev https://golang.org/cl/6355104 --- src/pkg/math/big/nat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/math/big/nat.go b/src/pkg/math/big/nat.go index 04f5dfd8ba..85b9acc0f5 100644 --- a/src/pkg/math/big/nat.go +++ b/src/pkg/math/big/nat.go @@ -236,7 +236,7 @@ func karatsubaSub(z, x nat, n int) { // Operands that are shorter than karatsubaThreshold are multiplied using // "grade school" multiplication; for longer operands the Karatsuba algorithm // is used. -var karatsubaThreshold int = 32 // computed by calibrate.go +var karatsubaThreshold int = 40 // computed by calibrate.go // karatsuba multiplies x and y and leaves the result in z. // Both x and y must have the same length n and n must be a -- 2.48.1