-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Document performance considerations tokio::fs #2700
Comments
Is it possible to use |
Using |
We likely want to create a section on the website for this. I am happy to contribute to this one. |
I opened an issue on the website repository too. |
Add a note on some functoins/methods that belong to `fs` to let the user note that they are blocking, and handled by spawn_blocking. Ref: tokio-rs#2700
It seems like this issue is no longer relevant (i think?), as the docs for fs mention that blocking tasks are spawned for the operations |
What about having another API that specifically uses block_in_place, that users can use if they chose to, and that way we will both prevent having a breaking-change that breaks other uses, and both possibly let users benefit from performance improvements |
That seems like a thing you can trivially do yourself with block_in_place and std::fs::File. |
Closing as fixed by #6467. Tokio will not encourage use of |
All file operations are currently spawned on a thread pool with
spawn_blocking
which is rather expensive. We should document these performance considerations a lot better than we are doing now.Refs: #1976, #1844
The text was updated successfully, but these errors were encountered: