tokio 0.2.4, see https://github.com/tokio-rs/tokio/blob/0d38936b35779b604770120da2e98560bbb6241f/tokio/src/io/blocking.rs#L29.
There's an unexpected 16 KB limit for IO operations, e.g. this will print 16384. It seems intended, but it's somewhat confusing.
async fn run() -> Result<(), std::io::Error> {
let mut file = File::open("x.mkv").await?;
let mut buf = [0u8; 32768];
let size = file.read(&mut buf).await?;
println!("{}", size);
Ok(())
}
Looking at your original issue, I think we can support better performance by working directly with Bytes. In that case, we can avoid the copying and instead send the bytes handle to the remote thread.
I鈥檇 like to work on this. Some guidance would be appreciated.
Especially around
I think we can support better performance by working directly with Bytes
Most helpful comment
Looking at your original issue, I think we can support better performance by working directly with
Bytes. In that case, we can avoid the copying and instead send the bytes handle to the remote thread.