Skip to content

How fast is a write to memory as compared to disk drives?



This is a very good representation of the speed of writes to RAM as against
the speed of the disk drive.
This test was carried on a 2.4 GHz 8-core i7, 8GB RAM Ubuntu laptop.

>>Writing to swap which will be basically memory mapped file
time dd if=/dev/zero of=/run/zero ibs=10240 count=10000
10000+0 records in
200000+0 records out
102400000 bytes (102 MB) copied, 0.161455 s, 634 MB/s
0.00 user
0.15 system
0:00.16 elapsed 97%CPU (0 avg text+ 0 avg data 3696 maxresident)k
0 inputs + 0 outputs ( 0 major + 285 minor ) pagefaults 0 swaps

>> Writing to file system
time dd if=/dev/zero of=/home/user/zero ibs=10240 count=10000
10000+0 records in
200000+0 records out
102400000 bytes (102 MB) copied, 0.394104 s, 260 MB/s

real 0m0.396s
user 0m0.012s
sys 0m0.380s

It would be very interesting to see what will be the results on an android
device, which has mostly flash storage.
There was the following link floating around HN some time back which listed
some of the latencies, pasting a short excerpt :

>>>>

L1 cache reference 0.5 ns
.
.
Main memory reference 100 ns 20x L2
cache, 200x L1 cache
.
.
Disk seek 10,000,000 ns 10 ms 20x
datacenter roundtrip
Read 1 MB sequentially from disk 20,000,000 ns 20 ms 80x
memory, 20X SSD
Send packet CA->Netherlands->CA 150,000,000 ns 150 ms

>>>>

The following link has all the complete list :
https://gist.github.com/jboner/2841832




Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*