Skip to content

Conversation

@kotauskas
Copy link

As b3sum does not attempt to recover from panics (nor does it have any reason to attempt to do that), it has no use for Rust's default behavior of unwinding on panics. Switching b3sum to panic = "abort" makes the executable about 13% smaller (from 1.5 MiB to 1.3 MiB) and possibly provides more optimization opportunities to LLVM. Note that this does not impact the display of backtraces, which are still displayed using libunwind – the only features that are disabled are the ability to catch panics using std::panic::catch_unwind and the non-fatal nature of panics in non-main threads.

@oconnor663
Copy link
Member

oconnor663 commented Oct 14, 2025

That makes sense to me. What's your thinking around doing it in dev + release vs just in release? (Is there any chance we'll miss some extra debug info or something when tests panic at failed asserts?)

(CI failures are clearly unrelated, upstream issue.)

@kotauskas
Copy link
Author

kotauskas commented Oct 15, 2025

What's your thinking around doing it in dev + release vs just in release?

Mostly just consistency, but it might improve compile times a tiny bit.

Is there any chance we'll miss some extra debug info or something when tests panic at failed asserts?

Tests always use unwinding panics even if you have panic = "abort" in [profile.dev]. As for the unwind tables, they seem to get generated either way, just without the unneeded landing pads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants