Questionmark operator performance regression


#1

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?


#2

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.


#3

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


#4

In any case please open an issue at http://github.com/rust-lang/rust - this should not get lost.


#5

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


#6

#7

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