3 ms·
Providing a set of "representative" inputs to optimize for is at least as much as what profile guided optimization gives the compiler (the compiler can always g
by Someone 5y ago
Providing a set of "representative" inputs to optimize for is at least as much as what profile guided optimization gives the compiler (the compiler can always generate a profile from that input set)
The “intrinsic character of the algorithm used”, I think, would mean the programmer has to tell the compiler how to do this faster, which I think the OP did when writing something along the lines of
if n < divisor
n
else
if n < 2 * divisor
n - divisor
else
n % divisor