Enabling debug symbols negatively affects the optimiser #49227
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I have a crate of moderate complexity, which I have recently been profiling.
When I enable
debug = true
in conjunction withopt-level = 3
, andlto = true
, I'm noticing a reduction in performance of the compiled code versus justopt-level = 3
, andlto = true
. The builds with debug info are exhibiting highly accurate debug symbols even for small functions which I would expect to have been inlined.I'm curious whether this behaviour is by design, and if so, why we are in the opposite camp to C++ compilers, which in my experience prioritise optimisations over accuracy of debug symbols?
The text was updated successfully, but these errors were encountered: