Interesting to read that frame pointer omission may not be worth it:
> You'd think that saving a whole register would mean a performance improvement, right? Especially on 32-bit x86 code where registers are at a premium. But it turns out that the cost savings are really pretty neglible. A Microsoft research paper from 2009 talks about measurements that were made in the performance of Windows with and without frame pointers. They found that there was no statistically provable benefit of FPO, and it was decided to disable FPO in Windows XP SP2! A similar investigation was done by Fedora and it was found that performance was typically only 2% different. When Meta enabled frame pointers sometime around 2017, they compared performance between a comparable set of hosts with and without FPO and found no difference.
> So why do we continue using FPO? Probably to make life more difficult for people who write debuggers.
Same with profilers. We had to go through a lot of trouble to get unwinding without frame pointers to work on the eBPF-based profiler we work on [1], and even crazier for interpreted languages [2].
Ah. nice It is about the process of writing a debugger from scratch. Part 6 specifically focuses on walking call stacks, which is a crucial feature for understanding the state of a program during debugging. The author explains the complexities of stack walking in the context of an x64 Windows debugger, providing detailed insights and code examples. Thanks
[+] [-] asicsp|2 years ago|reply
Discussion for part-5 (Breakpoints): https://news.ycombinator.com/item?id=37670938 (320 points | 57 days ago | 51 comments)
[+] [-] schemescape|2 years ago|reply
> You'd think that saving a whole register would mean a performance improvement, right? Especially on 32-bit x86 code where registers are at a premium. But it turns out that the cost savings are really pretty neglible. A Microsoft research paper from 2009 talks about measurements that were made in the performance of Windows with and without frame pointers. They found that there was no statistically provable benefit of FPO, and it was decided to disable FPO in Windows XP SP2! A similar investigation was done by Fedora and it was found that performance was typically only 2% different. When Meta enabled frame pointers sometime around 2017, they compared performance between a comparable set of hosts with and without FPO and found no difference.
> So why do we continue using FPO? Probably to make life more difficult for people who write debuggers.
[+] [-] brancz|2 years ago|reply
[1] https://www.polarsignals.com/blog/posts/2022/11/29/dwarf-bas...
[2] https://www.polarsignals.com/blog/posts/2023/10/04/profiling...
[+] [-] matheusmoreira|2 years ago|reply
[+] [-] leowwwa|2 years ago|reply
[+] [-] Ygg2|2 years ago|reply
[+] [-] darkclouds|2 years ago|reply
[deleted]