Skip to content

Commit

Permalink
Configure and unconfigure bencher OS
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Feb 9, 2024
1 parent 52d6f35 commit 93d3929
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ jobs:
name: Benchmark
runs-on: self-hosted
if: ${{ github.event.workflow_run.conclusion == 'success' }}
defaults:
run:
shell: bash

steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
Expand All @@ -31,16 +35,36 @@ jobs:
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get install -y --no-install-recommends gyp mercurial ninja-build lld python-is-python3 zlib1g-dev
sudo apt-get install -y --no-install-recommends \
git gyp mercurial ninja-build lld python-is-python3 zlib1g-dev \
linux-tools-common linux-tools-generic linux-tools-$(uname -r)
echo "RUSTFLAGS=-C link-arg=-fuse-ld=lld" >> "$GITHUB_ENV"
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}

- name: Prepare machine
run: |
# Disable turboboost
echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
# Disable hyperthreading
echo off > /sys/devices/system/cpu/smt/control
# Use performance governor
cpupower frequency-set -g performance
- name: Benchmark
run: cargo +$TOOLCHAIN bench --features ci,bench | tee output.txt
run: nice -n -10 taskset -c 0 cargo +$TOOLCHAIN bench --features ci,bench | tee output.txt

- name: Restore machine
run: |
# Enable turboboost
echo 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
# Enable hyperthreading
echo on > /sys/devices/system/cpu/smt/control
# Use powersave governor
cpupower frequency-set -g powersave
- name: Download previous benchmark results
uses: actions/cache@v4
Expand Down

0 comments on commit 93d3929

Please sign in to comment.