Skip to content

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Dec 7, 2024

Closes #22161.

Release Notes

Frame pointers make both debugging and profiling work better and the overhead is reportedly 1% or less for typical programs. For these reasons, Zig will now enable frame pointers for all build modes by default, with the exception of ReleaseSmall (which strips debug info and thus makes frame pointers have little value). For people who care about the overhead of frame pointers, they can still be disabled through the -fomit-frame-pointer compiler flag or the omit_frame_pointer option in the Zig Build System.

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 ziglang#22161.

[0] https://www.brendangregg.com/blog/2024-03-17/the-return-of-the-frame-pointers.html
@alexrp alexrp requested a review from andrewrk December 7, 2024 20:34
@andrewrk andrewrk enabled auto-merge (rebase) December 7, 2024 22:45
@andrewrk andrewrk added the release notes This PR should be mentioned in the release notes. label Dec 7, 2024
@andrewrk andrewrk merged commit e62aac3 into ziglang:master Dec 8, 2024
10 checks passed
@alexrp alexrp deleted the omit-frame-pointer branch December 8, 2024 12:43
@alexrp alexrp mentioned this pull request Dec 10, 2024
3 tasks
@alexrp alexrp mentioned this pull request Dec 19, 2024
8 tasks
@alexrp alexrp mentioned this pull request May 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release notes This PR should be mentioned in the release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReleaseSafe executables for aarch64-linux only prints out first step of backtrace

2 participants