First off remember system OS'es, and controllers, are always setup for caching and buffering, so use DirectIO, here is an example syntax that should work on most flavors of Linux/Unix, or try Cygwin on Windows to achieve the same. So to me it seems amazingly universal but you tell me, is there a more universal tool than “dd” out there that's more powerful and more standard for a fast memory to device copy test.
$ time dd if=/dev/zero of=tstfile bs=2048k count=512 oflag=direct 2048+0 records in 2048+0 records out 1073741824 bytes (1.1 GB) copied, 3.53208 s, 304 MB/s real 0m3.619s user 0m0.187s sys 0m0.217s
Direct Read Test
You can reverse things to see what the read test looks like, things should be faster on reads in all cases with respect to the SSD:
$ time dd of=/dev/null if=tstfile bs=2048k count=512 iflag=direct 2048+0 records in 2048+0 records out 1073741824 bytes (1.1 GB) copied, 3.45007 s, 311 MB/s real 0m3.463s user 0m0.015s
Read Cache Test
(testing the DRAM memory, and system in this case)
$ time dd of=/dev/null if=tstfile bs=2048k count=512 2048+0 records in 2048+0 records out 1073741824 bytes (1.1 GB) copied, 0.280394 s, 3.8 GB/s real 0m0.296s user 0m0.000s sys 0m0.296s
Direct write: 1073741824 bytes (1.1 GB) copied, 14.604 s, 73.5 MB/s Direct read: 1073741824 bytes (1.1 GB) copied, 16.7439 s, 64.1 MB/s Read cache: 1073741824 bytes (1.1 GB) copied, 0.354082 s, 3.0 GB/s
Benchmarking an encrypted filesystem, the speed drops to around 370MB/sec write, 430MB/sec read.
Direct write: 2147483648 bytes (2,1 GB, 2,0 GiB) copied, 5,11402 s, 420 MB/s Direct read: 2147483648 bytes (2,1 GB, 2,0 GiB) copied, 4,7174 s, 455 MB/s Read cache: 2147483648 bytes (2,1 GB, 2,0 GiB) copied, 0,295798 s, 7,3 GB/s
Direct write: 1073741824 bytes (1,1 GB, 1,0 GiB) copied, 3,23224 s, 332 MB/s Direct read: 1073741824 bytes (1,1 GB, 1,0 GiB) copied, 3,14576 s, 341 MB/s Read cache: 1073741824 bytes (1,1 GB, 1,0 GiB) copied, 0,151628 s, 7,1 GB/s
With this fast SSD a larger blocksize (32M) was needed to reach the GB/s speed.
Direct write: 1073741824 bytes (1,1 GB, 1,0 GiB) copied, 0,889314 s, 1,2 GB/s Direct read: 1073741824 bytes (1,1 GB, 1,0 GiB) copied, 0,513717 s, 2,1 GB/s Read cache: 1073741824 bytes (1,1 GB, 1,0 GiB) copied, 0,154132 s, 7,0 GB/s
Direct write: 1073741824 bytes (1.1 GB) copied, 100.578 s, 10.7 MB/s Direct read: 1073741824 bytes (1.1 GB) copied, 47.0731 s, 22.8 MB/s Read cache: 1073741824 bytes (1.1 GB) copied, 49.5828 s, 21.7 MB/s
Direct write: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 53.5692 s, 20.0 MB/s Direct read: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 25.1142 s, 42.8 MB/s Read cache: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.49443 s, 718 MB/s
Write speed was not stable, device very hot.
Direct write: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 23.8766 s, 45.0 MB/s Direct read: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 9.29304 s, 116 MB/s Read cache: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.56342 s, 687 MB/s
Direct write: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 4.71707 s, 228 MB/s Direct read: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 3.50969 s, 306 MB/s Read cache: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.53438 s, 700 MB/s
Direct write: 1073741824 bytes (1.1 GB) copied, 41.7628 s, 25.7 MB/s Direct read: 1073741824 bytes (1.1 GB) copied, 5.9659 s, 180 MB/s Read cache: 1073741824 bytes (1.1 GB) copied, 1.15947 s, 926 MB/s
Direct write: 1073741824 bytes (1.1 GB) copied, 3.51081 s, 306 MB/s Direct read: 1073741824 bytes (1.1 GB) copied, 3.0644 s, 350 MB/s Read cache: 1073741824 bytes (1.1 GB) copied, 1.44341 s, 744 MB/s
Direct write: 1073741824 bytes (1.1 GB) copied, 9.86249 s, 109 MB/s Direct read: 1073741824 bytes (1.1 GB) copied, 3.82096 s, 281 MB/s Read cache: 1073741824 bytes (1.1 GB) copied, 0.10913 s, 9.8 GB/s
Direct write: 1073741824 bytes (1.1 GB) copied, 3.20435 s, 335 MB/s Direct read: 1073741824 bytes (1.1 GB) copied, 3.21506 s, 334 MB/s Read cache: 1073741824 bytes (1.1 GB) copied, 0.192178 s, 5.6 GB/s
Direct write: 1073741824 bytes (1.1 GB) copied, 2.17193 s, 494 MB/s Direct read: 1073741824 bytes (1.1 GB) copied, 2.17759 s, 493 MB/s Read cache: 1073741824 bytes (1.1 GB) copied, 0.110266 s, 9.7 GB/s
Direct write: 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 3.82946 s, 1.1 GB/s Direct read: 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 2.96632 s, 1.4 GB/s Read cache: 4294967296 bytes (4.3 GB, 4.0 GiB) copied, 2.86754 s, 1.5 GB/s
Direct write: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 3.17625 s, 338 MB/s Direct read: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 2.68052 s, 401 MB/s Read cache: 1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.769217 s, 1.4 GB/s