-
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 StrSearcher::haystack() #42714
Conversation
r? @BurntSushi |
@bors r+ |
📌 Commit ca52d80 has been approved by |
@bors r- (see: #42716 (comment)) |
@alexcrichton I discovered this by accident when inspecting assembly of one of my programs in release mode. I was surprised to find lots of calls to that function here and there when it's just a getter to the field. I thought this method is an easy catch for the optimizer to inline (provided the attribute is there), basically 2 instructions to make a call to the function and 6 instructions in the function itself become 2 |
Oh don't worry, I understand how All I personally want is an anecdote or benchmarking showing the necessity of such tags. We have not always been so principled in the past, but it's very easy to go overboard with Sounds like you hit this when benchmarking, though, so sounds good to me, thanks! @bors: r+ |
📌 Commit ca52d80 has been approved by |
@bors rollup |
Inline StrSearcher::haystack()
Inline StrSearcher::haystack()
No description provided.