-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Mark smaller CStr and CString functions as #[inline] #42716
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @BurntSushi (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
Seems reasonable to me! Thanks! @bors r+ |
📌 Commit d131f86 has been approved by |
I did pretty much exactly this originally in #37622 but was told to remove it. |
@ollie27 Oh hmm, all right. I'll stop this and #42714 and ask @alexcrichton to take a look. @alexbool Sorry about the mixup. Could you maybe say more about why you want these |
@bors r- |
I feel the same as before. If we've got numbers then sounds good to me, otherwise let's hold off. |
@alexcrichton the motivation here is similar to #42714. To be completely honest, some methods I marked here as |
My thinking here is the same over there, it's very easy to go overboard with My worry is yes, that functions like |
@alexcrichton I discovered these while profiling an application which is heavy on C interop including string operations. I have seen some of these methods in the profile.
Following methods are small enough in my opinion to be inlined, but are not critical for my particular application:
Other methods that I marked as inline in this PR seem like not so small. |
Ok sounds reasonable to me, thanks for taking the time to type that out! @bors: r+ |
📌 Commit d131f86 has been approved by |
Oh wait @alexcrichton, I think you hurried, I haven't updated the PR yet to remove inlines on larger things like |
@bors r- |
cc282d2
to
d25f54d
Compare
Ready to go |
@bors r+ |
📌 Commit bcb5b13 has been approved by |
Mark smaller CStr and CString functions as #[inline]
Travis gave a clean bill of health but the appveyor webhook appears to have failed as the build never started. I'm going to unilaterally declare the risk of a windows-only regression here "low" and merge anyway! If this decision is in error I'll revert. |
Thanks for your time gentlemen! |
No description provided.