Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sqrt.go: remove allocations from Newton functions
name old time/op new time/op delta Exp2Prec53-4 69.4µs ± 4% 61.0µs ± 1% -12.09% (p=0.008 n=5+5) Exp2Prec100-4 154µs ± 0% 137µs ± 0% -11.39% (p=0.008 n=5+5) Exp2Prec1000-4 1.07ms ± 0% 0.98ms ± 0% -7.91% (p=0.008 n=5+5) Exp2Prec10000-4 14.5ms ± 0% 14.3ms ± 0% -0.97% (p=0.008 n=5+5) Exp2Prec100000-4 426ms ± 0% 426ms ± 0% ~ (p=0.222 n=5+5) Log2Prec53-4 63.1µs ± 0% 56.4µs ± 0% -10.63% (p=0.008 n=5+5) Log2Prec100-4 69.9µs ± 0% 64.7µs ± 3% -7.44% (p=0.008 n=5+5) Log2Prec1000-4 216µs ± 0% 196µs ± 1% -9.02% (p=0.008 n=5+5) Log2Prec10000-4 3.65ms ± 0% 3.60ms ± 0% -1.33% (p=0.008 n=5+5) Log2Prec100000-4 134ms ± 2% 133ms ± 0% ~ (p=0.151 n=5+5) Sqrt2Prec53-4 1.16µs ± 0% 1.16µs ± 0% ~ (p=0.087 n=5+5) Sqrt2Prec100-4 2.38µs ± 4% 2.27µs ± 5% ~ (p=0.127 n=5+5) Sqrt2Prec1000-4 8.47µs ± 0% 7.28µs ± 0% -14.07% (p=0.008 n=5+5) Sqrt2Prec10000-4 51.4µs ± 1% 49.6µs ± 0% -3.43% (p=0.008 n=5+5) Sqrt2Prec100000-4 972µs ± 0% 974µs ± 0% ~ (p=0.151 n=5+5) name old allocs/op new allocs/op delta Exp2Prec53-4 593 ± 0% 461 ± 0% -22.26% (p=0.008 n=5+5) Exp2Prec100-4 1.28k ± 0% 0.99k ± 0% -22.46% (p=0.008 n=5+5) Exp2Prec1000-4 5.86k ± 0% 4.35k ± 0% -25.76% (p=0.008 n=5+5) Exp2Prec10000-4 13.5k ± 0% 9.9k ± 0% -26.90% (p=0.008 n=5+5) Exp2Prec100000-4 27.0k ± 0% 19.7k ± 0% -27.19% (p=0.008 n=5+5) Log2Prec53-4 539 ± 0% 419 ± 0% -22.26% (p=0.008 n=5+5) Log2Prec100-4 590 ± 0% 458 ± 0% -22.37% (p=0.008 n=5+5) Log2Prec1000-4 1.24k ± 0% 0.90k ± 0% -27.53% (p=0.008 n=5+5) Log2Prec10000-4 2.70k ± 0% 1.96k ± 0% -27.28% (p=0.008 n=5+5) Log2Prec100000-4 5.21k ± 0% 3.89k ± 0% -25.35% (p=0.008 n=5+5) Sqrt2Prec53-4 14.0 ± 0% 14.0 ± 0% ~ (all samples are equal) Sqrt2Prec100-4 23.0 ± 0% 21.0 ± 0% -8.70% (p=0.008 n=5+5) Sqrt2Prec1000-4 63.0 ± 0% 43.0 ± 0% -31.75% (p=0.008 n=5+5) Sqrt2Prec10000-4 92.0 ± 0% 60.0 ± 0% -34.78% (p=0.008 n=5+5) Sqrt2Prec100000-4 128 ± 0% 84 ± 0% -34.38% (p=0.008 n=5+5)
- Loading branch information