使用自带的 单元测试工具 unit_test\linux\benchmark\bandwidth 进行测试,
自带的readme如下:
Bandwidth performs sequential and random reads and writes of varying sizes.
This permits you to see in the numbers how each type of memory is performing.
So for instance when bandwidth writes a 256-byte chunk, you know that because caches are normally write-back, this chunk will reside entirely in the L1 cache.
Whereas a 512 kB chunk will mainly reside in L2.
You could run a non-artificial benchmark and observe that a general performance number is lower on that machine, but that conceals the cause.
So the purpose of this program is to help you pinpoint the cause of a performance problem, and determine whether it is memory related.
It also tells you the best-case scenario i.e. the maximum bandwidth achieved using sequential, 128-bit memory accesses.
运行bandwidth-arm-thread结果如下:
运行bandwidth-arm结果如下: