relative timings (shouldn't be off by more than a factor of 100 ;-)
- memory-access in cache = 1
- function call/return in cache = 2
- memory-access out of cache = 10 .. 300
- disk access = 1000 .. 1e8 (amortized depends upon the number of bytes transferred)
- depending mostly upon seek times
- the transfer itself can be pretty fast
- involves at least a few thousand ops, since the user/system threshold must be crossed at least twice; an I/O request must be scheduled, the result must be written back; possibly buffers are allocated...
- network calls = 1000 .. 1e9 (amortized depends upon the number of bytes transferred)
- same argument as with disk i/o
- the raw transfer speed can be quite high, but some process on the other computer must do the actual work
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…