4 ms·
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
by raggi 3y ago
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.
- noncoml 3y agoI was talking about this: let mut file = File::open(path)?; let mut contents = String::new(); file.read_to_string(&mut contents)?;