Skip to content

Make Errno::result() inline #1518

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

Merged
merged 1 commit into from
Sep 12, 2021
Merged

Make Errno::result() inline #1518

merged 1 commit into from
Sep 12, 2021

Conversation

linkmauve
Copy link
Contributor

This makes the success case a single cmpl $-1, %eax followed with a non-taken conditional jump, instead of the current callq which is always taken.

I have not benchmarked the difference, but it is an obvious improvement.

This makes the success case a single `cmpl $-1, %eax` followed
with a non-taken conditional jump, instead of the current `callq`
which is always taken.

I have not benchmarked the difference, but it is an obvious
improvement.
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I usually frown on #[inline], but if you've actually checked the assembly then it's definitely worthwhile.

bors r+

@bors bors bot merged commit f44a506 into nix-rust:master Sep 12, 2021
@linkmauve linkmauve deleted the patch-1 branch September 15, 2021 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants