-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Summary
It seems closure in unwrap_or_else doesn't inlined
Line 1854 in a25d58b
self.get(slice).unwrap_or_else(|| super::slice_error_fail(slice, start, end)) |
Line 1921 in a25d58b
self.get(slice).unwrap_or_else(|| super::slice_error_fail(slice, 0, end)) |
Line 1986 in a25d58b
self.get(slice).unwrap_or_else(|| super::slice_error_fail(slice, start, end)) |
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
Benchmark
Code
Result
running 4 tests
test benches::bar_itself ... bench: 195 ns/iter (+/- 0) = 5261 MB/s
test benches::bar_long ... bench: 2,311 ns/iter (+/- 14) = 5374 MB/s
test benches::foo_itself ... bench: 383 ns/iter (+/- 2) = 2678 MB/s
test benches::foo_long ... bench: 4,606 ns/iter (+/- 7) = 2696 MB/s
test result: ok. 0 passed; 0 failed; 0 ignored; 4 measured; 0 filtered out
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.