-
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
String::from and str::to_owned are not inlined #53681
Comments
It might be prudent to also investigate whether similar one-liner functions are inlined (if they haven’t an |
I can have a look tomorrow. |
Note on the side: for |
Right, because it starts allocating stuff. It will result in larger binary (if actually inlined), but that already happens for |
The |
Interesting, so if I understand correctly the motivation for the "outlining" was to make the functions generate the same code by llvm. |
Adding |
I did a quick and dirty test and |
Here are the size change numbers of some tools (sizes in bytes):
|
liballoc: mark str.to_owned() and String::from(&str) as #[inline]. Fixes #53681
How much faster is it? |
liballoc: mark str.to_owned() and String::from(&str) as #[inline]. Fixes #53681
Playground (Use show assembly or llvm-ir, make sure to turn on optimisations)
All these functions should be equivalent.
The text was updated successfully, but these errors were encountered: