3 ms·
Has anyone measured the performance impact of the -fno-strict-aliasing flag? How much real-world performance are we really gaining from all this mess?
by sapiogram 2y ago
Has anyone measured the performance impact of the -fno-strict-aliasing flag? How much real-world performance are we really gaining from all this mess?
- twoodfin 2y agoObviously it’s going to vary from program to program. And you always have to be skeptical that removing the safety for performance hasn’t given you a faster but faulty program. That being said, my intuition matches what little anecdotal data I’ve seen from real perf-sensitive systems, and I’d ballpark 10-15% where it matters.
- gpderetta 2y agoDepends a lot on the application. For many it matters little, but for some (mostly numerical), it can matter a lot.
- 73kl4453dz 2y agoLack of aliasing was historically fortran's advantage over C.
- lmm 2y agoReal-world performance: not enough to be measurable, certainly remotely enough to make up for the time we lose to debugging. But no-one cares about real-world performance, people pick C and pick a C compiler because they want the thing that's fastest on artificial microbenchmarks.
- sestep 2y agoNot sure if this is exactly the same scope as what you're asking about, but here's an ESSE '21 paper titled "The Impact of Undefined Behavior on Compiler Optimization": https://doi.org/10.1145/3501774.3501781 https://doi.org/10.1145/3501774.3501781
- sapiogram 2y agoIt's paywalled, is there a way to actually read it?