You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to_owned is not marked #[inline] while String::from is. Check the assembly, one is inlined and the other isn't. It probably doesn't matter and in fact I can't measure any performance difference with short strings (and long ones are probably dominated by the memcpy anyway). Maybe we should just stop inlining from to make binaries a tiny bit smaller. Either way, it's unfortunate that these two conversion methods, which are often described as being exactly equivalent, aren't.
The text was updated successfully, but these errors were encountered:
Call str::to_owned in String::from and uninline it
Call str::to_owned in String::from and uninline it
These methods were already effectively equal, but now one calls
the other, and neither is marked inline.
String::from does not need to be inlined, it can be without it just like
str::to_owned and String::clone are.
Fixes#32163
to_owned
is not marked#[inline]
whileString::from
is. Check the assembly, one is inlined and the other isn't. It probably doesn't matter and in fact I can't measure any performance difference with short strings (and long ones are probably dominated by the memcpy anyway). Maybe we should just stop inliningfrom
to make binaries a tiny bit smaller. Either way, it's unfortunate that these two conversion methods, which are often described as being exactly equivalent, aren't.The text was updated successfully, but these errors were encountered: