5 ms·
It was very beneficial on the register-starved x86, but I notice less impact on amd64. I definitely also have a debug-mode that builds with -g and without -s -
by byuu 13y ago
It was very beneficial on the register-starved x86, but I notice less impact on amd64.
I definitely also have a debug-mode that builds with -g and without -s -O3 -fomit-frame-pointer.
- dap 13y agoIt's good to have it at least in dev, but many bugs only show up in production, and performance work can only usefully be done on the shipping, optimized code.
- astrange 13y agoamd64 has enough registers that using one for the frame pointer isn't too bad. On the other hand, some platforms don't need a frame pointer for debugging; if you emit correct unwind tables that's enough for the debugger to construct a backtrace. I haven't looked lately but am pretty sure amd64 ELF is one of them. Also, modern gcc generates okay debug info for optimized programs such that it's much more likely you can read variables out of a crash in gdb.
- dap 13y ago> On the other hand, some platforms don't need a frame pointer for debugging; if you emit correct unwind tables that's enough for the debugger to construct a backtrace. I haven't looked lately but am pretty sure amd64 ELF is one of them. Working with unwind tables is more complicated and many useful debugging tools don't do so.