| author | |
| committer | |
| log | e62aac3ec4b21da20d7c57d937e508f2929138d0 |
| tree | be5628cb1c50b0c2aa8ea9ea9ca017ec5b6e229c |
| parent | ba37a4369b936c3fe4ad4f4b1d61bc93d9936018 |
Frame pointers make both debugging and profiling work better, and the overhead
is reportedly 1% or less for typical programs [0]. I think the pros outweigh the
cons here. People who *really* care about that 1% can simply use the
-fomit-frame-pointer option to reclaim it. For ReleaseSmall, though, it makes
sense to omit frame pointers by default for the sake of code size, as we already
strip the binary in this case anyway.
Closes #22161.
[0] https://www.brendangregg.com/blog/2024-03-17/the-return-of-the-frame-pointers.html1 files changed, 2 insertions(+), 2 deletions(-)
src/Package/Module.zig+2-2| ... | @@ -205,8 +205,8 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module { | ... | @@ -205,8 +205,8 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module { |
| 205 | const omit_frame_pointer = b: { | 205 | const omit_frame_pointer = b: { |
| 206 | if (options.inherited.omit_frame_pointer) |x| break :b x; | 206 | if (options.inherited.omit_frame_pointer) |x| break :b x; |
| 207 | if (options.parent) |p| break :b p.omit_frame_pointer; | 207 | if (options.parent) |p| break :b p.omit_frame_pointer; |
| 208 | if (optimize_mode == .Debug) break :b false; | 208 | if (optimize_mode == .ReleaseSmall) break :b true; |
| 209 | break :b true; | 209 | break :b false; |
| 210 | }; | 210 | }; |
| 211 | 211 | ||
| 212 | const sanitize_thread = b: { | 212 | const sanitize_thread = b: { |