Hacker News new | past | comments | ask | show | jobs | submit login

The buffered read didn’t do that, it used the default buffered reader implementation. IIRC that implementation currently defaults to 8kb buffer windows which is a little too small to be efficient enough for high throughput, but substantially more performant than making a syscall per byte, and without spending too much memory.



I was talking about this:

    let mut file = File::open(path)?;
    let mut contents = String::new();
    file.read_to_string(&mut contents)?;




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: