2 ms·
In many contexts, one should rarely pass -O2/-O3. A project that is built thousands of times during development may only be run on intensive workloads (where -O
by cvoss 3y ago
In many contexts, one should rarely pass -O2/-O3. A project that is built thousands of times during development may only be run on intensive workloads (where -O2 performance is actually a necessity) a handful of times by comparison. A dev build can usually be -O0, which can dramatically improve compilation time.
- htfy96 3y agoIt depends. O0 turns off a few trimming optimizations and could potentially causes more information (code or DWARF) to be included in the objects, which may eventually slow down the compilation. In our large code base, we found that -O1 works best in terms of compilation speed.
- ahartmetz 3y agoYeah, -O1 is usually a good choice. I get the occasional <value optimized out> while debugging, well I add another logging statement and rerun.
- deleted 3y ago[deleted]
- rerdavies 3y agoThere doesn't seem to be a significant difference between -O0 and -O2/-O3 compile times.