&str slicing using SliceIndex is slow #68874
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-slow
Issue: Problems and improvements with respect to performance of generated code.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
Summary
It seems closure in unwrap_or_else doesn't inlined
rust/src/libcore/str/mod.rs
Line 1854 in a25d58b
rust/src/libcore/str/mod.rs
Line 1921 in a25d58b
rust/src/libcore/str/mod.rs
Line 1986 in a25d58b
I can't make PR because I don't know how can I fix should this code don't use
unwrap_or_else
? or need some patch for optimizer or LLVM?Godbolt
https://godbolt.org/z/TBhkjy
Benchmark
Code
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=765da897030741f77b13ce397dc7f882
Result
The text was updated successfully, but these errors were encountered: