• Alberto Donizetti's avatar
    math/big: avoid allocation in float.{Add, Sub} when there's no aliasing · cda633b3
    Alberto Donizetti authored
    name               old time/op    new time/op    delta
    FloatAdd/10-4         116ns ± 1%      82ns ± 0%   -28.74%  (p=0.008 n=5+5)
    FloatAdd/100-4        124ns ± 0%      86ns ± 1%   -30.34%  (p=0.016 n=4+5)
    FloatAdd/1000-4       192ns ± 1%     123ns ± 0%   -35.94%  (p=0.008 n=5+5)
    FloatAdd/10000-4      826ns ± 0%     438ns ± 0%   -46.99%  (p=0.000 n=4+5)
    FloatAdd/100000-4    6.82µs ± 1%    3.36µs ± 0%   -50.74%  (p=0.008 n=5+5)
    FloatSub/10-4         108ns ± 1%      77ns ± 1%   -29.06%  (p=0.008 n=5+5)
    FloatSub/100-4        115ns ± 0%      79ns ± 0%   -31.48%  (p=0.029 n=4+4)
    FloatSub/1000-4       168ns ± 0%      99ns ± 0%   -41.09%  (p=0.029 n=4+4)
    FloatSub/10000-4      690ns ± 2%     288ns ± 1%   -58.24%  (p=0.008 n=5+5)
    FloatSub/100000-4    5.37µs ± 1%    2.10µs ± 1%   -60.89%  (p=0.008 n=5+5)
    
    name               old alloc/op   new alloc/op   delta
    FloatAdd/10-4         48.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatAdd/100-4        64.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatAdd/1000-4        176B ± 0%       0B ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatAdd/10000-4     1.41kB ± 0%   0.00kB ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatAdd/100000-4    13.6kB ± 0%    0.0kB ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatSub/10-4         48.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatSub/100-4        64.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatSub/1000-4        176B ± 0%       0B ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatSub/10000-4     1.41kB ± 0%   0.00kB ±NaN%  -100.00%  (p=0.008 n=5+5)
    FloatSub/100000-4    13.6kB ± 0%    0.0kB ±NaN%  -100.00%  (p=0.008 n=5+5)
    
    Fixes #14868
    
    Change-Id: Ia2b8b1a8ef0868288ecb25f812b17bd03ff40d1c
    Reviewed-on: https://go-review.googlesource.com/23568Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    cda633b3
Name
Last commit
Last update
..
accuracy_string.go Loading commit data...
arith.go Loading commit data...
arith_386.s Loading commit data...
arith_amd64.s Loading commit data...
arith_amd64p32.s Loading commit data...
arith_arm.s Loading commit data...
arith_arm64.s Loading commit data...
arith_decl.go Loading commit data...
arith_decl_pure.go Loading commit data...
arith_mips64x.s Loading commit data...
arith_ppc64x.s Loading commit data...
arith_s390x.s Loading commit data...
arith_test.go Loading commit data...
bits_test.go Loading commit data...
calibrate_test.go Loading commit data...
decimal.go Loading commit data...
decimal_test.go Loading commit data...
doc.go Loading commit data...
example_rat_test.go Loading commit data...
example_test.go Loading commit data...
float.go Loading commit data...
float_test.go Loading commit data...
floatconv.go Loading commit data...
floatconv_test.go Loading commit data...
floatexample_test.go Loading commit data...
floatmarsh.go Loading commit data...
floatmarsh_test.go Loading commit data...
ftoa.go Loading commit data...
gcd_test.go Loading commit data...
hilbert_test.go Loading commit data...
int.go Loading commit data...
int_test.go Loading commit data...
intconv.go Loading commit data...
intconv_test.go Loading commit data...
intmarsh.go Loading commit data...
intmarsh_test.go Loading commit data...
nat.go Loading commit data...
nat_test.go Loading commit data...
natconv.go Loading commit data...
natconv_test.go Loading commit data...
rat.go Loading commit data...
rat_test.go Loading commit data...
ratconv.go Loading commit data...
ratconv_test.go Loading commit data...
ratmarsh.go Loading commit data...
ratmarsh_test.go Loading commit data...
roundingmode_string.go Loading commit data...