-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Inline {min,max}_value
even in debug builds
#64941
Conversation
a7dec48
to
3b49ab6
Compare
@bors try @rust-timer queue |
Awaiting bors try build completion |
⌛ Trying commit 3b49ab6 with merge 61430923b8b2f3e7565c7aa30a3eb96474641bd6... |
☀️ Try build successful - checks-azure |
Queued 61430923b8b2f3e7565c7aa30a3eb96474641bd6 with parent 22bc9e1, future comparison URL. |
Isn't perf only measuring compiler performance (which is always built in release mode)? |
So how can I measure debug build of compiler? I saw this code generated from debug build (godbolt link: https://godbolt.org/z/9cpH6U) core::num::<impl u32>::max_value:
mov eax, 4294967295
ret
example::bar:
push rax
call core::num::<impl u32>::max_value
mov dword ptr [rsp + 4], eax
mov eax, dword ptr [rsp + 4]
pop rcx
ret That code is generated from: pub fn bar() -> u32 {
u32::max_value()
} So I think |
{min,max}_value
even in debug builds{min,max}_value
even in debug builds
r? @nnethercote (randomly assign) |
@bors r+ |
📌 Commit 3b49ab6 has been approved by |
⌛ Testing commit 3b49ab6 with merge aa84c93d98bab674e7b7953cc30dd70f6d4cd0c1... |
…hercote Inline `{min,max}_value` even in debug builds I think it is worth to inline `{min,max}_value` even in debug builds. See this godbolt link: https://godbolt.org/z/-COkVS
@bors retry rolled up. |
☔ The latest upstream changes (presumably #65045) made this pull request unmergeable. Please resolve the merge conflicts. |
The godbolt example says to me to just stop using See also rust-lang/rfcs#2700 |
I think it is worth to inline
{min,max}_value
even in debug builds.See this godbolt link: https://godbolt.org/z/-COkVS