Skip to content

Instantly share code, notes, and snippets.

@giovannicuccu
giovannicuccu / runperf
Last active August 31, 2025 13:54 — forked from grahamking/runperf
Bash script to run a benchmark under decent conditons.
#!/bin/bash
#
# this is a modified copy of https://gist.github.com/grahamking/9c8c91b871843a9a6ce2bec428b8f48d
# the differences are AMD cpu detection and the ability to run this script via sudo
# Usage: runperf ./my-benchmark-binary
#
# Script to run a benchmark / performance test in decent conditions. Based on:
# - https://www.llvm.org/docs/Benchmarking.html
# - "Performance Analysis and Tuning on Modern CPU" by Denis Bakhvalov, Appendix A.
# - https://github.com/andikleen/pmu-tools