3 ms·
Which is prime example as to how C does not consider timing to be observable behavior. What the code does is that it tries to specify the operation in sufficien
by dfox 6y ago
Which is prime example as to how C does not consider timing to be observable behavior. What the code does is that it tries to specify the operation in sufficiently complex way that makes compiler give up on any optimizations.
- dvdkhlng 6y agoNote how this problem of "sufficient complexity" is an asymmetric problem between code author and compiler. A rather simple transformation implemented by the author to make the code constant-time may require NP-hard effort for the compiler to undo. (but then the compiler may still do other unrelated transformations that end up making the code non-constant time again)