Questionmark operator performance regression

Seeing that ? operator landed on stable in 1.13 and that my project is still not being used anywhere so breaking compatibility with users on lower versions isn't an issue, I went ahead and replaced all try! macros I had with ?. The result is a roughly 20% performance loss: https://github.com/ratel-rust/ratel-core/pull/48#issuecomment-261301646

Nothing in the code has changed aside from the try! -> ? change. Are there any side effects of the ? operator that the try! macro does not have - something that would prevent inlining for example?

Profiling before and after would be useful to see if inlining decisions de facto changed. There are more functions involved, going through the Carrier trait, but it can all be inlined if the compiler wants to.

Does this happen with a debug or a release (optimized) build?

In any case please open an issue at GitHub - rust-lang/rust: Empowering everyone to build reliable and efficient software. - this should not get lost.

1 Like

@terhix Did you report this bug? Couldn't find any issue on github.

https://github.com/rust-lang/rust/issues/37939

1 Like

Thanks for doing this. I'm on holidays with sparse access to the internet, I'll try to investigate further when possible.