Skip to content
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

Override read_exact and write_all #75

Merged
merged 4 commits into from Jul 26, 2022

Conversation

Kixunil
Copy link
Contributor

@Kixunil Kixunil commented Jul 24, 2022

Some types override these methods to provide optimizations. Using
default implementations would bypass those overrides and lead to worse
performance.

Overriding the methods to delegate implementations directly solves the
problem.

Some types override these methods to provide optimizations. Using
default implementations would bypass those overrides and lead to worse
performance.

Overriding the methods to delegate implementations directly solves the
problem.
@cuviper
Copy link
Member

cuviper commented Jul 25, 2022

Do you have examples of types that override these specific methods?

If we do these, should we also override/forward as many other io methods as we can? There are still some left, even constrained by our MSRV, like read_to_string and write_fmt and some BufRead stuff.

@Kixunil
Copy link
Contributor Author

Kixunil commented Jul 25, 2022

&[u8] is a typical example and I do it for my own type too.

should we also override/forward as many other io methods as we can?

Probably yes, I think it's OK to skip MSRV-restricted.

Copy link
Member

@cuviper cuviper left a comment

Choose a reason for hiding this comment

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

Thanks! I added those few more.

@cuviper cuviper merged commit fad7d3a into rayon-rs:master Jul 26, 2022
@Kixunil Kixunil deleted the read_exact_write_all branch July 27, 2022 11:56
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.

None yet

2 participants