From 2e8d669564a8a1e0211b9970d4c6b048bf1a5ab5 Mon Sep 17 00:00:00 2001 From: DivvyCr Date: Fri, 1 May 2020 16:40:17 +0100 Subject: [PATCH 1/2] Support benchmarking reports and lower the benching time. --- .github/workflows/benchmarking.yml | 17 ++++++++++++++--- carball/tests/benchmarking/benchmarking.py | 10 +++++----- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/.github/workflows/benchmarking.yml b/.github/workflows/benchmarking.yml index 4d2d9f4a..b4fe2b3f 100644 --- a/.github/workflows/benchmarking.yml +++ b/.github/workflows/benchmarking.yml @@ -40,7 +40,18 @@ jobs: - name: Run benchmark. run: | cd carball/tests/benchmarking - pytest benchmarking.py + pytest benchmarking.py --benchmark-json carball_benchmarking.json -# TO BE DONE. -# - name: Store benchmark result(s). \ No newline at end of file + # REQUIRES gh-pages BRANCH IN THE MAIN REPO (for the graphs). + - name: Process and store benchmark. + uses: rhysd/github-action-benchmark@v1 + with: + name: Carball Benchmarks + tool: 'pytest' + output-file-path: carball/tests/benchmarking/carball_benchmarking.json + # Use personal access token instead of GITHUB_TOKEN due to https://github.community/t5/GitHub-Actions/Github-action-not-triggering-gh-pages-upon-push/td-p/26869/highlight/false + github-token: ${{ secrets.GITHUB_TOKEN }} + auto-push: true + alert-threshold: '125%' # If performance is 1.25x worse, there will be an alert + comment-always: true + comment-on-alert: true \ No newline at end of file diff --git a/carball/tests/benchmarking/benchmarking.py b/carball/tests/benchmarking/benchmarking.py index 24a5d785..df11b978 100644 --- a/carball/tests/benchmarking/benchmarking.py +++ b/carball/tests/benchmarking/benchmarking.py @@ -14,32 +14,32 @@ def test_short_sample(benchmark): replay_path = get_replay_path("SHORT_SAMPLE.replay") benchmark.pedantic(analyze_replay_file, - kwargs={"replay_path":replay_path}, rounds=50, iterations=3) + kwargs={"replay_path":replay_path}, rounds=10, iterations=3) def test_short_dropshot(benchmark): replay_path = get_replay_path("DROPSHOT_PHASE2_BALL.replay") benchmark.pedantic(analyze_replay_file, - kwargs={"replay_path":replay_path}, rounds=30, iterations=3) + kwargs={"replay_path":replay_path}, rounds=10, iterations=3) def test_full_rumble(benchmark): replay_path = get_replay_path("RUMBLE_FULL.replay") benchmark.pedantic(analyze_replay_file, - kwargs={"replay_path":replay_path}, rounds=20, iterations=3) + kwargs={"replay_path":replay_path}, rounds=10, iterations=3) def test_oce_rlcs(benchmark): replay_path = get_replay_path("OCE_RLCS_7_CARS.replay") benchmark.pedantic(analyze_replay_file, - kwargs={"replay_path":replay_path}, rounds=20, iterations=3) + kwargs={"replay_path":replay_path}, rounds=10, iterations=3) def test_oce_rlcs_intensive(benchmark): replay_path = get_replay_path("OCE_RLCS_7_CARS.replay") benchmark.pedantic(analyze_replay_file, - kwargs={"replay_path":replay_path, "calculate_intensive_events":True}, rounds=5, iterations=3) + kwargs={"replay_path":replay_path, "calculate_intensive_events":True}, rounds=5, iterations=1) From be2a4c30a17e56e626771b65f40f464fb436c617 Mon Sep 17 00:00:00 2001 From: DivvyCr Date: Fri, 1 May 2020 16:40:17 +0100 Subject: [PATCH 2/2] Support benchmarking reports and lower the benching time. --- .github/workflows/benchmarking.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmarking.yml b/.github/workflows/benchmarking.yml index b4fe2b3f..8198da09 100644 --- a/.github/workflows/benchmarking.yml +++ b/.github/workflows/benchmarking.yml @@ -2,7 +2,7 @@ name: Benchmarking on: push: - branches: [ master, action-benchmark ] + branches: [ master, benchmarking-data ] jobs: build: