Estimating your memory bandwidth
lemire.me
lemire.me
There are some really complicated effects as well, such as: TLB cache misses, huge pages, and NUMA.
For example, on typical two-socket servers, half the memory is "faster" and half the memory is "slower" because it is attached to the remote CPU.
Here's an example: https://images.anandtech.com/doci/17024/BandwidthCPU_575px.p...
If I actually set it to the size of physical memory performance is _much_ lower, as OSX tries to compress the RAM it is using.
# hdparm -T /dev/sda
/dev/sda:
Timing cached reads: 19110 MB in 1.99 seconds = 9582.36 MB/sec
Which quickly tells me single-threaded memory bandwidth of ~10GB/s (i7 X230 ThinkPad w/2x8GB SODIMMs(16GB))It's often interesting to run multiple of these simultaneously and observe how much the per-core and aggregate bandwidth increases/decreases with increased parallelism.
I grabbed this and compiled it with gcc https://github.com/lemire/Code-used-on-Daniel-Lemire-s-blog/...
g++ -std=gnu++17 -O3 -o bandwidth bandwidth.cpp && ./bandwidth > 50.0 > ...
50 GB/s, it drops slowly to 45GB/s with 32 threads)
sudo hdparm -T /dev/nvme0n1
> Timing cached reads: 58222 MB in 1.99 seconds = 29230.67 MB/sec
It's a good lower bound though
For me it's an almost certain upvote, i.e. I'm glad that this got posted and already looking forward to the next one.