3 ms·
> Can you provide even one real-world example where this makes a difference, i.e. not some microbenchmark Sure. I don't even have to leave this thread to find
by msbarnett 5y ago
> Can you provide even one real-world example where this makes a difference, i.e. not some microbenchmark
Sure. I don't even have to leave this thread to find one: https://news.ycombinator.com/item?id=27223954 https://news.ycombinator.com/item?id=27223954 reports a measurable speed impact to PostgreSQL when compiled with -fwrapv, which rules out the exact optimization in question.
This shouldn't be surprising; loops are extremely common and superscalar processors benefit enormously from almost anything other than a naïve translation of them.
Here's -fwrapv cutting performance of a function in half in Cython vs the non-fwrapv compilation: https://stackoverflow.com/questions/46496295/poor-performance-of-c-function-in-cython https://stackoverflow.com/questions/46496295/poor-performanc...
- vyodaiken 5y agoSure, if you leave out error checks code runs faster. Compile mutexes to no-ops and get an even better speedup.