-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce an example binary useful for profiling #646
Conversation
Cool idea, should we be doing this for our other crates (specifically as we crate smash them out of |
We may want a |
Certainly it is useful in other crates too, but at the moment in particular this crate and its companion elements-miniscript have high percentage of binary size consumption in downstream libraries due to the high use of generics so it makes the most sense here. |
Why do you think this is not meant to be in this repo? Thanks to the |
Sorry, I didn't actually look at the diff (because I am waiting for #645 to get in so that CI will work). I didn't realize it was actually an example in the Yes, this should certainly stay in this repo. My comments about wanting a maintainer-tools repo are separate -- we should have this anyway so we can deduplicate our test scripts and write "end to end" tests of the whole ecosystem. |
Rebased and added some calls: in debug big executable is 72Mb and the second biggest example is 51Mb (41% bigger) |
examples/big.rs
Outdated
@@ -0,0 +1,40 @@ | |||
// SPDX-License-Identifier: CC0-1.0 | |||
//! This is not an example and will surely panic if executed, the purpose of this is using the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In ec751fb:
trailing space after the
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the formatter got this in the last commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK c8d3b9a thanks!
Let's get this in. It's a super useful benchmark. I am planning to give "redo the error types" a shot in the coming week and hopefully I can get this size down. |
Tools like
cargo bloat
don't work on libraries but on final executable.As seen in #585 and #584 the parse example is used as a base to profile binary bloat.
However, since the parse example is not using all the API surface, we may have good optimization that are not recognized as such because the optimized function are not in the tree of the functions used.
For benchmarking size optimization a specific binary that ideally touch all the API surface is needed and this MR introduce it.
More coverage will be added if this seem a good idea for reviewers.