-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Inline Windows OsStrExt::encode_wide
#97841
Conversation
User crates currently produce much more code than necessary because the optimizer fails to make assumptions about this method.
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
(rust-highfive has picked a reviewer for you, use r? to override) |
friendly reminder @joshtriplett |
Do you have any result that shows this inlining is helpful e.g. generated assembly? |
Inlining iterator constructors does tend to be beneficial, as it's required to constant fold anything having to do with the iterator, and allows propagation of checks (for example, if a length check exists prior to construction of the iterator, the compiler only knows that continues to hold if the construction of the iterator is inlined). They also tend to be small, as this one looks to be. As a non-generic stdlib function, I wouldn't expect this to get inlined without this, and it doesn't https://rust.godbolt.org/z/4xf8d1T6h. So I think this is fine, and am going to accept it. @bors r+ |
Inline Windows `OsStrExt::encode_wide` User crates currently produce much more code than necessary because the optimizer fails to make assumptions about this method.
☀️ Test successful - checks-actions |
Finished benchmarking commit (7d1f57a): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
User crates currently produce much more code than necessary because the optimizer fails to make assumptions about this method.