Fedora 37 Weighing Change To Improve Profiling/Debugging But With Possible Performance Cost
The change proposal being evaluated is about adding the "-fno-omit-frame-pointer" to the default compilation flags as a system-wide change. This compiler option will make sure for C/C++ programs that the frame pointer is always available so that debugging/profiling tools can use it for providing accurate performance data.
They hope this will lead to performance improvements in core libraries and executables, but by not omitting the frame pointer there are possible performance implications. The default behavior of not using the frame pointer can save three instructions per function and can treat the RBP frame/base pointer register as a general purpose register to be used for something else.
Meta/Facebook internal benchmarks found that building with "-fno-omit-frame-pointer" hadn't impacted two of their most performance-intensive applications. But data in 2017 from SUSE with a Linux 4.18 kernel showed that there were 5~10% regressions in some benchmarks.
Fedora developers do acknowledge the risk of this change regressing some workloads, to which the change proposal suggests individual packages could opt-out of this compiler flag change if they find their performance significantly impaired. The change proposal for Fedora 37 is being suggested by Facebook/Meta engineers.
The details on this change proposal can be found via the Fedora Wiki.
On the Fedora mailing list is much discussion already over this proposed "-fno-omit-frame-pointer" behavior by default and the possible negative impact it could have on performance. There's multiple individuals calling for more performance testing to better quantify the potential impact, including Phoronix benchmarking.
I haven't looked at "-fno-omit-frame-pointer" costs myself but will put that on my TODO list for some initial benchmarks at least for the impact of using "-fno-omit-frame-pointer" on standalone workloads/benchmarks while that may not capture the full impact of rebuilding the entire operating system with this change, at least it will have a starting point. It will be interesting to see what is decided by this proposed change for Fedora 37 given the possible performance hit to end-users in the name of a better performance profiling and debugging experience.