Skip to content

Conversation

antifuchs
Copy link
Collaborator

@antifuchs antifuchs commented Mar 31, 2025

Maybe this can be faster.

In any case, this PR restructures the code such that it becomes somewhat clearer what's going on:

  • We no longe use io::copy to compare data on disk with what "should" be there, instead implementing the comparison loop ourselves.
  • Errors raised during write / read operations now tell users that we're uncertain if the disk is working or not.

@antifuchs antifuchs changed the title Manually implement copying and comparing Use compio for completion-based async operation Mar 31, 2025
@antifuchs antifuchs force-pushed the push-kzqntwomqwzz branch 5 times, most recently from 1640a23 to 047f970 Compare March 31, 2025 22:29
@antifuchs
Copy link
Collaborator Author

OK, this looks about 2x as slow on linux than the naive-most sync implementation, which is both kind of a surprise and ... not? I'm not happy that the silly sync impl is apparently our perf ceiling but ok.

@antifuchs antifuchs force-pushed the push-kzqntwomqwzz branch 8 times, most recently from e10c780 to ec34c2e Compare April 2, 2025 13:20
Unfortunately, its AsyncRead/AsyncWrite trait isn't implemented by fs::File, which means it isn't compatible with its own io::copy function. That's not fantastic.
io::copy isn't *that* smart, and it is less unclear to understand what's going on if we manage buffers ourselves. Let's do that, and maybe gain a little flexibility in the future too.
@antifuchs antifuchs marked this pull request as draft August 6, 2025 19:54
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.

1 participant