Stream: project-ffi-unwind

Topic: measuring code size


view this post on Zulip tmandry (Nov 08 2019 at 07:58):

the rough numbers I have are, panic=abort reduces the size of a binary by 10%-20% on Fuchsia

view this post on Zulip gnzlbg (Nov 08 2019 at 10:59):

@tmandry it might be interesting to try building fuchsia with -C panic=unwind and a nightly toolchain from July, and then compare that with the current nightly toolchain.

view this post on Zulip gnzlbg (Nov 08 2019 at 10:59):

IIRC the current toolchain does not emit nounwind for extern C, while the one in July should do that.

view this post on Zulip gnzlbg (Nov 08 2019 at 11:00):

That would show the impact of this particular change there.

view this post on Zulip tmandry (Nov 08 2019 at 11:01):

the last numbers I gathered were from July/August timeframe

view this post on Zulip tmandry (Nov 08 2019 at 11:01):

@gnzlbg if you can point me to a particular change to apply/revert I could also do that

view this post on Zulip tmandry (Nov 08 2019 at 11:01):

the numbers might be a little noisy with other changes mixed in there

view this post on Zulip gnzlbg (Nov 08 2019 at 11:03):

@tmandry let me check

view this post on Zulip gnzlbg (Nov 08 2019 at 11:04):

@RalfJ I see https://github.com/rust-lang/rust/pull/65346 and https://github.com/rust-lang/rust/pull/65020 landed but it appears that none of these removed nounwind from all extern "C" definitions and declarations, did that happen somewhere already?

view this post on Zulip gnzlbg (Nov 08 2019 at 11:04):

Ah https://github.com/rust-lang/rust/pull/63909 is not merged.

view this post on Zulip gnzlbg (Nov 08 2019 at 11:04):

@tmandry you might want to apply https://github.com/rust-lang/rust/pull/63909 to the current nightly.

view this post on Zulip gnzlbg (Nov 08 2019 at 11:05):

then you can just compare the current nightly with that PR, in both cases with -C panic=unwind

view this post on Zulip gnzlbg (Nov 08 2019 at 11:06):

that should show the effect of making extern "C" definitions and declarations allow unwinding by default

view this post on Zulip nikomatsakis (Nov 08 2019 at 14:37):

I'm breaking this out into a distinct topic

view this post on Zulip nikomatsakis (Nov 08 2019 at 14:37):

Thanks @tmandry for those numbers! Very helpful to have an upper bound, and I agree the impact is non-trivial

view this post on Zulip nikomatsakis (Nov 08 2019 at 14:37):

Given that the impact is non-trivial, it seems like it is worth trying to dig in more, since the impact of these alternatives would be more limited, and it seems like it matters

view this post on Zulip nikomatsakis (Nov 08 2019 at 16:15):

I think at this point

view this post on Zulip nikomatsakis (Nov 08 2019 at 16:15):

these measurements are the single most important thing to do

view this post on Zulip nikomatsakis (Nov 08 2019 at 16:16):

I think @gnzlbg what we really want to compare is

view this post on Zulip nikomatsakis (Nov 08 2019 at 16:16):

what is the cost if we insert "abort" shims around "C" FFI calls, but otherwise use -Cpanic=abort

view this post on Zulip nikomatsakis (Nov 08 2019 at 16:16):

I don't think we can estimate that yet, do we need to do a prototype impl to do so?

view this post on Zulip nikomatsakis (Nov 08 2019 at 16:16):

(Maybe @Amanieu is interested in doing so?)

view this post on Zulip BatmanAoD (Kyle Strand) (Nov 09 2019 at 00:10):

@nikomatsakis do you have a sense of what threshold should be considered "significant", and how it would impact our design decisions? The data is interesting, but I'm having a little trouble tracking how it will inform our next steps.

view this post on Zulip Josh Triplett (Nov 09 2019 at 03:45):

The size might determine whether it's reasonable to have C default to unwind or nounwind.

view this post on Zulip Josh Triplett (Nov 09 2019 at 03:45):

Or at least the impact of those choices.

view this post on Zulip nikomatsakis (Nov 11 2019 at 21:01):

nikomatsakis do you have a sense of what threshold should be considered "significant", and how it would impact our design decisions? The data is interesting, but I'm having a little trouble tracking how it will inform our next steps.

I feel like 10% is significant

view this post on Zulip nikomatsakis (Nov 11 2019 at 21:01):

I'm not saying <10% is not significant :)

view this post on Zulip nikomatsakis (Nov 11 2019 at 21:02):

I guess I think the threshold is probably somewhere around 2 or 3%? I don't really know.

view this post on Zulip nikomatsakis (Nov 11 2019 at 21:02):

I'd prefer to have the number because there are certain things where it's clear -- 0.1%, or 10% :)

view this post on Zulip nikomatsakis (Nov 11 2019 at 21:02):

in other words, I don't think there is a firm threshold

view this post on Zulip BatmanAoD (Kyle Strand) (Nov 11 2019 at 21:59):

Okay, that's fair enough.


Last updated: Jan 26 2022 at 08:46 UTC