Simple Example Microbenchmarks
A few simple microbenchmarks for you to test.
Note that some of the benchmarks do something useful, but others do not. The beauty of microbenchmarks is that they don't have to be meaningful, just evoke interesting behavior in the microarchitecture.
- bfs - Breadth-first search graph traversal. Irregular memory access pattern.
- lfsr - Linear feedback shift register. Pseudo-random memory access.
- merge - Merge sort. Recursive divide-and-conquer with unpredictable branches.
- mm - Matrix multiplication. Compute-intensive with blocked/tiled access.
- spmv - Sparse matrix-vector multiplication. Indirect memory access (CSR format).
Some benchmarks require generated input arrays:
randArr.h- Random integer array (used by merge)spmvArr.h- Sparse matrix data in CSR format (used by spmv)graphArr.h- Random graph in CSR format (used by bfs)
These are generated by Python scripts invoked from the Makefile. Feel free to play with the parameters of these scripts.
Make all the benchmarks with the following command:
make
To build with different optimization levels:
make OPT=-O1