Live data from Hacker News

Ubuntu 24.04 LTS will enable frame pointers by default

ubuntu.com

111–120 of 121 posts

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#111
post #41

Earlier quoted context omitted.

Profiling tools have already solved the ability to reliably unwind in the absence of frame pointers[1], but there are plenty of tools that this kind of investment is simply too much that it won't ever happen, like bpftrace or bcc-tools. [1] https://www.polarsignals.com/blog/posts/2022/11/29/dwarf-bas...

Do those tools really need to implement their own unwinding though? This really should just need to be implemented once in a library and then used wherever unwinding is needed.

With the combination of eBPF and DWARF-based it's not quite that simple, there's a pretty elaborate dance between user-space and kernel-space that needs to happen for this to work. With frame-pointers it's walking a linked list in kernel-space.

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#112
post #2

Frame pointers are such a destructive micro-optimization to omit by default, I am beyond excited about this collaboration with the folks at Canonical to make Ubuntu debuggable by default!

It's a "micro" optimization that can be automatically applied everywhere. And its not destructive because debug info contains all you need to calculate the frame pointers after the fact. Really a no-brainer to have it on unless you are dealing with broken tools.

We've "fixed"[1] all the tooling that we work on at Polar Signals, and even then I think this is the right thing to do. It enables so much more debuggability aside from profiling.

[1] https://www.polarsignals.com/blog/posts/2022/11/29/dwarf-bas...

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#113
post #99

Earlier quoted context omitted.

> So the whole world should take a 1-2% performance penalty on everything so some users can maybe run a profiler? If so, I'm all for it. The win from easy access to profiling can dwarf this 1-2%

That's assuming you can't profile without frame pointers which is simply not true. If some tools have issues then fix them.

No, it's only assuming that you can more easily (with less overhead) profile with frame providers. Which is simply true.

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#114

Earlier quoted context omitted.

I don't know where 1-2% comes from, but for many scale production workloads I studied it was so close to 0% that it was tough to measure beyond noise on the cloud. That's not to say that 1-2% is wrong, but that it's likely someone's workload and other people see less. Helping people find ~30-3000% perf wins, helping debugging and automated bug reports, is huge. For some sites it may be like 300 steps forward, one ste…

Eeven 0.1% scaled accross all users is a huge amount of wasted energy. You can profile without subjecting everyone to frame pointers.

Not nearly as much as the missed optimizations from not having this easily available.

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#115
post #6

Earlier quoted context omitted.

This option was almost certainly a holdover from the bad old 32-bit x86 days, when disabling frame pointers gave you a seventh valuable general-purpose register. It's no longer beneficial on x86_64 -- even with rbp locked down, you still have fourteen registers there.

Yeah, back in the 32 bit days -fomit-frame-pointer was the only optimization you could count on to really make a difference. It wasn't small either, often 10-15% speedup. No other flag on gcc would make even a full percentage difference in my testing. The Amd64 architecture fixed the underlying problem, so this is pretty much just a holdover. I'm surprised they even enabled it by default.

(iirc) I think I used `-fomit-frame-pointer` with DJGPP on DOS on a 486. It was an [unimpressive :)] software-rendered 3D graphics demo, and I was very happy with the substantial free speedup I got.

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#116
post #90

Earlier quoted context omitted.

Also, apparently Intel is planning to extend x86_64 to 32 GPRs, with an extension called... sigh [0]... Intel APX[1]. So the overhead of frame pointers will be even lower in the future. [0] Intel APX is extremely confusable with the iAPX 432, a failed non-x86 architecture Intel made that's completely unrelated to doubling the size of the x64 register file. [1] https://www.intel.com/content/www/us/en/developer/article…

iAPX has been dead for almost 40 years; there probably won't be much confusion.

It's not dead. It's sleeping.

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#117

Earlier quoted context omitted.

I've seen how instantly-available profiles affect the engineering culture on practice and it's transformative. The difference between "yeah strange, I'll deploy an fp build some time later and check... maybe" and "see this thing right here on the flamegraph" is huge and often repays 5-15x of the initial 1% slowdown.

This x1000 This "1%" loss will never manifest. It will be pure gain.

Single digit percentages are noise in moore-units. Layout has a bigger effect. So many "optimizations" in our tech culture are around removing the headlights and brakes so that the car can go slightly faster in the dark, on hills.

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#119

So the whole world should take a 1-2% performance penalty on everything so some users can maybe run a profiler? Wouldn't it make more sense to just have an 'apt reinstall all --with-frame-pointers' command that power users could run before they wanted to profile something?

I don't know where 1-2% comes from, but for many scale production workloads I studied it was so close to 0% that it was tough to measure beyond noise on the cloud. That's not to say that 1-2% is wrong, but that it's likely someone's workload and other people see less. Helping people find ~30-3000% perf wins, helping debugging and automated bug reports, is huge. For some sites it may be like 300 steps forward, one ste…

> Our analysis suggests that the penalty on 64-bit architectures is between 1-2% in most cases.

Right from the article. I find it a difficult subject, as a developer/poweruser I am happy to see framepointers. But I can not speak for others.

Re: Ubuntu 24.04 LTS will enable frame pointers by default

#120

Earlier quoted context omitted.

This x1000 This "1%" loss will never manifest. It will be pure gain.

Single digit percentages are noise in moore-units. Layout has a bigger effect. So many "optimizations" in our tech culture are around removing the headlights and brakes so that the car can go slightly faster in the dark, on hills.

Good analogy.

Stack traces and good performance profiles are table stakes to even starting to make good software imo

Post reply on HN