From c0eb020a788b0cd486b42714588746eeb2ef4917 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Tue, 13 Feb 2024 17:19:01 +0200 Subject: [PATCH] Benchmark a proper transfer --- .github/workflows/bench.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 37e31e545c..66dfef9d58 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -1,5 +1,7 @@ name: Bench on: + push: + pull_request: workflow_call: env: CARGO_PROFILE_BENCH_BUILD_OVERRIDE_DEBUG: true @@ -52,7 +54,9 @@ jobs: # Disable turboboost, hyperthreading and use performance governor. - name: Prepare machine - run: sudo /root/bin/prep.sh + run: | + sudo /root/bin/prep.sh + echo 'PERF_CMD="record -o perf.data -F997 --call-graph dwarf,16384 -g"' >> "$GITHUB_ENV" # Pin the benchmark run to core 0 and run all benchmarks at elevated priority. - name: Benchmark @@ -65,9 +69,25 @@ jobs: - name: Perf transfer benchmark run: | nice -n -20 taskset -c 0 \ - cargo +$TOOLCHAIN flamegraph -v -c "record -o perf.data -F997 --call-graph dwarf,16384 -g" --features bench --bench transfer -- \ + cargo +$TOOLCHAIN flamegraph -v -c "$PERF_CMD" --features bench --bench transfer -- \ --bench --exact "Run multiple transfers with varying seeds" + - name: Benchmark a client/server transfer + run: | + cargo +$TOOLCHAIN build --profile bench --features bench --bin neqo-client --bin neqo-server + mkdir server && \ + cd server && \ + cargo +$TOOLCHAIN flamegraph -v -c "$PERF_CMD" --bin neqo-server -- $HOST:4433 & + PID=$! + mkdir client && \ + cd client && \ + cargo +$TOOLCHAIN flamegraph -v -c "$PERF_CMD" --bin neqo-client -- --output-dir . https://$HOST:4433/$SIZE + kill $PID + [ "$(wc -c <"$SIZE")" -eq "$SIZE" ] || exit 1 + env: + HOST: localhost + SIZE: 7654321 + # Re-enable turboboost, hyperthreading and use powersave governor. - name: Restore machine run: sudo /root/bin/unprep.sh