github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/math/big/calibrate_test.go (about) 1 // Copyright 2009 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Calibration used to determine thresholds for using 6 // different algorithms. Ideally, this would be converted 7 // to go generate to create thresholds.go 8 9 // This file prints execution times for the Mul benchmark 10 // given different Karatsuba thresholds. The result may be 11 // used to manually fine-tune the threshold constant. The 12 // results are somewhat fragile; use repeated runs to get 13 // a clear picture. 14 15 // Calculates lower and upper thresholds for when basicSqr 16 // is faster than standard multiplication. 17 18 // Usage: go test -run='^TestCalibrate$' -v -calibrate 19 20 package big