3 ms·
My immediate thought was are you measuring throughput or latency? The latency of reading from disk is indeed very slow compared to CPU instructions. A 3ghz cl
by samsquire 4y ago
My immediate thought was are you measuring throughput or latency?
The latency of reading from disk is indeed very slow compared to CPU instructions.
A 3ghz clock speed processor is running 3 billion (3,000,000,000 cycles a second) and some instructions take 1 cycle. You get 3 cycles per nanosecond. A SSD or spinning disk access costs many multiples of cycles.
Read 1 MB sequentially from SSD* 1,000,000
That's a lot of time that could be spent doing additions or looping.
https://gist.github.com/jboner/2841832 https://gist.github.com/jboner/2841832
- cb321 4y agoI agree - "IO bandwidth is no longer a BW bottleneck" would be a better title.
- formerly_proven 4y agoAnd you get 2-4 instructions per cycle on average.
- noctune 4y agoThat is true, but assuming file I/O is blocking you also have to pay for a context switch to take advantage of that. But I guess you could avoid that using eg. io_uring.