-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always inline arithmetic operators #62095
Always inline arithmetic operators #62095
Conversation
In release mode, this has no effect, as they're inlined anyway, but in debug mode LLVM otherwise lowers these to a call instruction -- much more expensive than the inlined version.
@bors try I want to try to run perf to make sure this doesn't regress compilation time |
⌛ Trying commit 363b20e with merge e300b3d1d935612cbd734b3683c726874af46838... |
☀️ Try build successful - checks-travis |
@rust-timer build e300b3d1d935612cbd734b3683c726874af46838 |
Success: Queued e300b3d1d935612cbd734b3683c726874af46838 with parent 166c49d, comparison URL. |
Finished benchmarking try commit e300b3d1d935612cbd734b3683c726874af46838, comparison URL. |
Looks like no compile time changes (as hoped for). |
IIUC this change only affects code that is generic over these operators, and there might not be much of that in the benchmarks. Perhaps the |
Perhaps. If @alexcrichton decides this is reasonable I'll collect perf before landing probably |
Can you add a comment somewhere indicating why they're |
I am unable to measure performance benefits, and since that's the main goal here I'm going to close this PR -- and the relevant issue. |
In release mode, this has no effect, as they're inlined anyway, but in
debug mode LLVM otherwise lowers these to a call instruction -- much
more expensive than the inlined version.
Fixes #12279
If we decide not to land this I think we should close #12279 as won't fix.
r? @alexcrichton