• Michael Munday's avatar
    math: fix Abs, Copysign and Signbit benchmarks · ffb4708d
    Michael Munday authored
    CL 62250 makes constant folding a bit more aggressive and these
    benchmarks were optimized away. This CL adds some indirection to
    the function arguments to stop them being folded.
    
    The Copysign benchmark is a bit faster because I've left one
    argument as a constant and it can be partially folded.
    
                         old           CL 62250     this CL
    Copysign             1.24ns ± 0%   0.34ns ± 2%  1.02ns ± 2%
    Abs                  0.67ns ± 0%   0.35ns ± 3%  0.67ns ± 0%
    Signbit              0.87ns ± 0%   0.35ns ± 2%  0.87ns ± 1%
    
    Change-Id: I9604465a87d7aa29f4bd6009839c8ee354be3cd7
    Reviewed-on: https://go-review.googlesource.com/62450
    Run-TryBot: Michael Munday <mike.munday@ibm.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarIan Lance Taylor <iant@golang.org>
    ffb4708d
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...