Would be nice with io_uring (or similar capability) in the kernel too then ;-)
so this will happen for AsyncSequence even if the iterator never actually suspends?
is there really no alternative to iterating over a non-async Sequence of Result<FilePath.Component, Errno>?
Say, it is a server or a server-like client, what' d be the best approach if I want to call multiple I/O operations like readdir in parallel? Create my own pool of threads? How many threads should be there in that pool on a N-core system? Or is the limiting factor something else, like my SSD driver? Ideally if I have a number of long operations running at the same time I'd still want another new quick operation to start and complete while the other long running operations are in progress.
In theory your goal there is to keep the command queue of your SSD ~full so that the controller has as many options as possible to maximize its own internal parallelism. That sounds hard though so I’d probably start with a second pool of NCPUs threads and maybe expose an environment variable to let people tune it on their actual server like people do with jvm settings.