-
Notifications
You must be signed in to change notification settings - Fork 151
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
Replace #[inline(always)] by #[inline] due to the later being conside… #141
Conversation
…red harmful Signed-off-by: Daniel Egger <daniel@eggers-club.de>
("being considered harmful" is not a very descriptive commit message / PR title, IMO.) For posteriority, could you please add a comment (or a link) with the rationale about the change to this PR? @homunkulus r+ |
📌 Commit 73cd404 has been approved by |
Replace #[inline(always)] by #[inline] due to the later being conside… …red harmful Signed-off-by: Daniel Egger <daniel@eggers-club.de>
Well, according to https://rust-lang-nursery.github.io/rust-clippy/master/index.html#inline_always it is considered harmful: It increases compile time and may increase size as well as decrease performance. I'm afraid I can't come up with a better label than "considered harmful". |
☀️ Test successful - status-appveyor, status-travis |
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 <daniel@eggers-club.de>
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 <daniel@eggers-club.de>
…red harmful
Signed-off-by: Daniel Egger daniel@eggers-club.de