-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Use inline(never) instead of cold #76262
Conversation
inline(never) is better way to avoid optimizer to inline the function instead of cold.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @cramertj (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. |
I presume you've checked to make sure this actually makes a difference in the final binary? |
@bors r+ rollup |
📌 Commit a80d390 has been approved by |
This seems safe enough of a change, though I'd prefer it if profiling data or examples of binary changes were available here. The docs on the function do specify that it is trying to avoid inlining, and this is the correct way to do that. |
Use inline(never) instead of cold inline(never) is better way to avoid optimizer to inline the function instead of cold.
Rollup of 10 pull requests Successful merges: - rust-lang#76056 (Add more info for Vec Drain doc) - rust-lang#76062 (Vec slice example fix style and show type elision) - rust-lang#76262 (Use inline(never) instead of cold) - rust-lang#76335 (Make all methods of `Duration` unstably const) - rust-lang#76366 (Add Arith Tests in Library) - rust-lang#76369 (Move Various str tests in library) - rust-lang#76534 (Add doc comments for From impls) - rust-lang#76622 (Update bootstrap readme) - rust-lang#76641 (Some cleanup changes and commenting) - rust-lang#76662 (Fix liballoc test suite for Miri) Failed merges: r? `@ghost`
|
inline(never) is better way to avoid optimizer to inline the function instead of cold.