Avoid allocations in Serializer when write numbers and characters#909
Avoid allocations in Serializer when write numbers and characters#909Mingun merged 2 commits intotafia:masterfrom
Conversation
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #909 +/- ##
==========================================
+ Coverage 55.52% 58.18% +2.65%
==========================================
Files 42 42
Lines 15511 15547 +36
==========================================
+ Hits 8613 9046 +433
+ Misses 6898 6501 -397
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| } | ||
|
|
||
| impl<W: Write> SimpleTypeSerializer<W> { | ||
| #[inline] |
There was a problem hiding this comment.
I'm pretty sure these #[inline] annotations do not actually accomplish anything. All it does is make the function bodies available to dependent crates for optimization purposes. But all of this code is internal to the crate anyway, and hence inline-able, and the compiler doesn't care about the #[inline] annotation when deciding whether or not to inline code within a compilation unit.
There was a problem hiding this comment.
#[inline(always)] does have some effect within compilation units but usually in a case like this the compiler would already be making the correct decision, at least in release mode.
There was a problem hiding this comment.
While #[inline] is a prerequisite for cross-crate inlining as you describe, it still adjusts LLVM's heuristics even for within-crate inlining towards inlining, i.e. it can have an effect even for internal functions.
There was a problem hiding this comment.
I've heard otherwise, but it's possible I'm wrong or that things have changed since I read about that.
No description provided.