Skip to content

Commit

Permalink
Benchmark a proper transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
larseggert committed Feb 13, 2024
1 parent a50b09a commit c0eb020
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Bench
on:
push:
pull_request:
workflow_call:
env:
CARGO_PROFILE_BENCH_BUILD_OVERRIDE_DEBUG: true
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c0eb020

Please sign in to comment.