Cut down on number formating code size#58272
Merged
bors merged 7 commits intorust-lang:masterfrom Feb 14, 2019
Merged
Conversation
Instead of inlining the same logic into every number formatting implementation, pull it out into a function that each of the number formatting impls call into.
For smaller code size.
The generic `F` in `with_padding` was causing a bunch of stuff to get inlined that otherwise needn't be, blowing up code size.
Member
Author
|
This got the new test case's code size down from 22871 to 20609: a savings of 2262 bytes (about 10%). |
Contributor
|
The job Click to expand the log.I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Mark-Simulacrum
requested changes
Feb 7, 2019
Mark-Simulacrum
approved these changes
Feb 8, 2019
Removes some unsafe *and* saves almost half a kilobyte of code size.
b4765f7 to
2ec556c
Compare
2ec556c to
f00f0e6
Compare
Member
|
@bors r+ |
Collaborator
|
📌 Commit f00f0e6 has been approved by |
Centril
added a commit
to Centril/rust
that referenced
this pull request
Feb 13, 2019
…k-Simulacrum Cut down on number formating code size r? @alexcrichton
Centril
added a commit
to Centril/rust
that referenced
this pull request
Feb 13, 2019
…k-Simulacrum Cut down on number formating code size r? @alexcrichton
Centril
added a commit
to Centril/rust
that referenced
this pull request
Feb 13, 2019
…k-Simulacrum Cut down on number formating code size r? @alexcrichton
bors
added a commit
that referenced
this pull request
Feb 13, 2019
Rollup of 10 pull requests Successful merges: - #58110 (libpanic_unwind => 2018) - #58167 (HirId-ify hir::BodyId) - #58202 (Ignore future deprecations in #[deprecated]) - #58272 (Cut down on number formating code size) - #58276 (Improve the error messages for missing stability attributes) - #58354 (Fix ICE and invalid filenames in MIR printing code) - #58381 (Only suggest imports if not imported.) - #58386 (Fix #54242) - #58400 (Fix rustc_driver swallowing errors when compilation is stopped) - #58420 (target/uefi: clarify documentation) Failed merges: r? @ghost
Merged
Contributor
|
Ooh. I'm really curious to see whether this has any noticeable impact on embedded. |
Contributor
|
Very nice! I'm seeing a reduction of up to 800B in .text size (or -28% in that specific example) on ARMv6m. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? @alexcrichton