-
Notifications
You must be signed in to change notification settings - Fork 156
improve dev builds #324
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
improve dev builds #324
Conversation
r? @Emilgardis (rust_highfive has picked a reviewer for you, use r? to override) |
@ryankurte can you review this PR? |
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.
lgtm!
bors r+ |
324: improve dev builds r=ryankurte a=therealprof This PR basically reverts #141 and plays with inline markers for some large dev build binary size gains Co-authored-by: Daniel Egger <[email protected]>
failed with
on several targets. |
src/generate/peripheral.rs
Outdated
#address as *const _ | ||
#[inline(always)] | ||
pub const fn ptr() -> *const #base::RegisterBlock { | ||
#address as _ |
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.
incorrect cast here (signed *i32
instead of unsigned *<width>
)
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.
That is very weird. Why could a elided type result in an incompatible pointer?
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.
Most likely the issue is not this change but the PhantomMarker
change above. Anyway let's back that out.
Signed-off-by: Daniel Egger <[email protected]>
This shaves off a couple of bytes of any dev build Signed-off-by: Daniel Egger <[email protected]>
Turns out this @therealprof dude was wrong in blindly following general consensus that #[inline(always)] was a bad idea. Revisiting the topic showed that just #[inline] is not enough to get even very trivial functions inlined in dev mode which causes a ton of bloat and a lot of debugging fun due to many emitted extra functions without any value for the developer. Usual binary reductions by this change are in the area of 10-15% which is a lot given that even a simply blinky on Cortex-M0 is several kB already. E.g. before: 0.5% 100.0% 4.0KiB .text section size, the file size is 734.1KiB after: 0.5% 100.0% 3.7KiB .text section size, the file size is 714.5KiB Signed-off-by: Daniel Egger <[email protected]>
5589a6c
to
3d101f9
Compare
@ryankurte I removed the problematic change. Please have another look. |
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.
👍
bors r+ |
324: improve dev builds r=ryankurte a=therealprof This PR basically reverts #141 and plays with inline markers for some large dev build binary size gains Co-authored-by: Daniel Egger <[email protected]>
Build succeeded |
This PR basically reverts #141 and plays with inline markers for some large dev build binary size gains