-
Notifications
You must be signed in to change notification settings - Fork 165
Feat: Add try_maps on AccountInfo Ref/RefMut #229
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
Conversation
|
Did you benchmark this kind of changes? |
sonicfromnewyoke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Aursen i expect small performance degradation
|
I'll benchmark it, but I doubt this would have any performance impacts. The compiler should optimize the error branch out. |
|
@Aursen @sonicfromnewyoke https://rust.godbolt.org/z/9YeWsr1oP map with try_map infallible under the hood compiles down to the same assembly, so this should have 0 performance impact. This should be trivial for the compiler to optimize. One of the reasons Infallible exists :) |
@stegaBOB it works even better than i expected, thanks the last question: what do you think about inlining? Will it be better to use |
I think |
In this case |
febo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👌
e914238 to
906c142
Compare
906c142 to
af6442f
Compare
febo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
No description provided.