←back to thread

164 points mpweiher | 2 comments | | HN request time: 0s | source
Show context
SleepyMyroslav ◴[] No.45119326[source]
Judging from a lot of points people find -O0 code useful. May I ask if someone from those people tell me how you find it useful? The question is based on following experience: if we have lots of C++ code then all of the std lib and ours abstractions are becoming zero cost only after inlining. Inlining implies at least -O1. Why people even build -O0 for large projects? And if a project is not large one then build times should not be that much of a problem.
replies(2): >>45119492 #>>45119860 #
saagarjha ◴[] No.45119492[source]
Debug builds don’t need to be fast. Or, at least, the benefits you get from faster compilation or better symbols outweigh the downsides.
replies(1): >>45119696 #
1. cout ◴[] No.45119696[source]
They do need to not be slow though, which is why I usually stick with -Og.
replies(1): >>45119801 #
2. saagarjha ◴[] No.45119801[source]
-Og trashes debug info