Skip to content

Commit

Permalink
Set CPU frequency governor and frequency before running the benchmarks (
Browse files Browse the repository at this point in the history
  • Loading branch information
zeme-wana authored Dec 3, 2024
1 parent 916e572 commit 72af216
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions nix/shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ let
'';


# Underlying benchmarking library used by plutus-benchmark and tasty-papi
papi-pkgs = lib.optional pkgs.hostPlatform.isLinux pkgs.papi;
papi-pkgs = lib.optionals pkgs.hostPlatform.isLinux [
# Needed to fix the frequency and governor of the CPU running the benchmarks
pkgs.cpufrequtils
# Underlying benchmarking library used by plutus-benchmark and tasty-papi
pkgs.papi
];


all-pkgs = [
Expand Down
4 changes: 4 additions & 0 deletions scripts/ci-plutus-benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ cabal clean
if [[ -z $(which taskset) ]]; then
TASKSET=""
else
echo "[ci-plutus-benchmark]: Setting CPU $CAPABILITY_NUM frequency governor to 'userspace' and frequency to 4.21GHz"
# This makes the benchmark reliable on a single core and addresses the issue of large variance in the results.
cpufreq-set --cpu $CAPABILITY_NUM --governor userspace
cpufreq-set --cpu $CAPABILITY_NUM --related --freq 4.21GHz
TASKSET="taskset -c $CAPABILITY_NUM"
fi

Expand Down

0 comments on commit 72af216

Please sign in to comment.