These are the results of a very basic memory benchmark (written in Python) on my laptop.
Laptop manufacturer specs:
- Lenovo - T460
- CPU i5-6200U: 2.3GHz (0.43 ns per cycle) (2 cores with hyperthreading)
- L1 cache 64 KB, hit rate 4 cycles = 1.72 ns
- L2 cache 512 KB, hit rate 10 cycles = 4.3 ns
- L3 cache 3072 KB, hit rate 40 cycles = 17.2 ns
- RAM DDR3-3200: 32GB, 1600 MHz (1.25 ns per cycle), CAS Latency 16 cycles, Total latency = CAS latency x cycle = 16*1.25 = 20 ns, Throughput 25.6 GB/s
-
Create on disk a collection of
Nnumpy arrays of sizeSfrom 2^9 to 2^28 bytes for all powers of two in between, that is from 512B up to 256MB. The arrays are of data typefloat64. Given that eachfloat64item is 8-bytes, this means the arrays are of lengthLfrom 8 to 33,554,432. -
Load the whole collection in memory by reading it in a single numpy array of size (
N,L) (good) or (L,N) (bad). The corresponding loop is# good loop for idx in range(N): ts[:, idx] = np.load(file)
# bad loop for idx in range(N): ts[idx, :] = np.load(file)
-
Time the bad and the good loop
-
Results files are named
result_N_Sfor eachNandS. Each result file contains (size, time bad (s), time good (s)). -
The plot above shows the ratio between the bad and the good timing as a function of
SforN=30.