-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.
Description
Consider these two functions:
pub fn bar(x: Result<String, String>) -> Result<String, String> {
Ok(x?)
}
pub fn baz(x: Result<String, String>) -> Result<String, String> {
x
}
Ideally the compiler should generate identical machine code. But it does not.
Because of this issue, ? operator is not as convenient to use in high performance parts of code. E. g.
fn f() -> Result<(), MyError> {
f1()?;
f2()?;
Ok(())
}
has to be written for performance as
fn f() -> Result<(), MyError> {
f1()?;
f2()
}
Metadata
Metadata
Assignees
Labels
I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.