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

Conditionally use more efficient strategies for polling file I/O #24

Open
notgull opened this issue Sep 17, 2023 · 4 comments
Open

Conditionally use more efficient strategies for polling file I/O #24

notgull opened this issue Sep 17, 2023 · 4 comments

Comments

@notgull
Copy link
Member

notgull commented Sep 17, 2023

For Windows there is file completion (for some operations, we'd have to fall back to blocking for others), for Linux there is io_uring and for BSD there is aio. It would be nice to use one of these strategies instead of the inefficient blocking code if they are available.

@nazar-pc
Copy link

nazar-pc commented Oct 5, 2023

Is IOCP an option for files on Windows?

I have a use case for doing 32k reads of 32 bytes and need to do it fast. On Windows with blocking I/O on a thread pool it is not fast at all comparing to Linux.

I might also be able to get a grant for this work if it is something of interest.

@notgull
Copy link
Member Author

notgull commented Oct 6, 2023

Is IOCP an option for files on Windows?

I have a use case for doing 32k reads of 32 bytes and need to do it fast. On Windows with blocking I/O on a thread pool it is not fast at all comparing to Linux.

I might also be able to get a grant for this work if it is something of interest.

I would very much appreciate this being worked on, as I don't have time for this at the moment. IOCP is an option for reading and writing files, along with some other operations that unfortunately don't include opening files. It may be faster than reading files using thread-based operations in some cases.

Here is a checklist of things that would need to happen in order for this to work:

  • Finish this PR, which is needed for completion packets to be used in the greater async system.
  • Expose this in async-io.
  • Take advantage of this in async-fs.

@notgull
Copy link
Member Author

notgull commented Nov 13, 2023

@nazar-pc Any updates?

@nazar-pc
Copy link

I have done experiments with other async I/O libraries (glommio, monoio) and found out that even if it is faster for reads, I have reads interleaved with compute and having thread pool is faster. To fix Windows performance issues file had to be opened multiple times, once in each thread of the thread pool rather than once and shared with all threads by reference.

So not really a priority anymore for the use case I had.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants