Skip to content

Conversation

@NobodyXu
Copy link
Contributor

set_non_blocking takes a generic parameter and it is used in two different places with different types.

Since it only uses the fd returned by pipe.as_raw_fd(), we could create an _inner function that takes the fd and do the job.

@NobodyXu NobodyXu mentioned this pull request Feb 20, 2024
@Amanieu
Copy link
Member

Amanieu commented Feb 20, 2024

Does this even make a noticeable impact? This is a single function that is only monomorphized twice, it's not like HashMap which has many methods and can be monomorphized for thousands of different types.It makes the code harder to read on the other hand.

@NobodyXu
Copy link
Contributor Author

It probably won't have much effect and I'm just being pedantic.

Though it really doesn't hurt, the code is quite simple and the change would make sure future use of it won't cause more monomorphisation.

@Amanieu
Copy link
Member

Amanieu commented Feb 20, 2024

Even if there are a few more monomorphizations, the impact of compiling one extra monomorphizationwill be unnoticeable. I'm still inclined not to merge this.

@NobodyXu
Copy link
Contributor Author

Got it, I will close this as not planned.

@NobodyXu NobodyXu closed this Feb 20, 2024
@NobodyXu NobodyXu deleted the optimize branch February 20, 2024 13:32
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.

3 participants