From d676170f84b0d899bb0ae34219316829f6f1a565 Mon Sep 17 00:00:00 2001 From: Bjerg Date: Mon, 29 May 2023 14:47:49 +0200 Subject: [PATCH] ci: various speed optimizations (#2867) --- .github/scripts/compare_iai.sh | 2 +- .github/workflows/bench.yml | 41 +++++++++++++++++-------------- .github/workflows/integration.yml | 7 ++---- .github/workflows/unit.yml | 2 +- 4 files changed, 27 insertions(+), 25 deletions(-) diff --git a/.github/scripts/compare_iai.sh b/.github/scripts/compare_iai.sh index 3f1ce1d90..733453d73 100755 --- a/.github/scripts/compare_iai.sh +++ b/.github/scripts/compare_iai.sh @@ -3,4 +3,4 @@ # This script should be run on the main branch, after running the iai benchmarks on the target branch. # If the main branch has a better iai performance, exits in error. It ignores L2 differences, since they seem hard to stabilize across runs. -cargo bench --package reth-db --bench iai | tee /dev/tty | awk '/((L1)|(Ins)|(RAM)|(Est))+.*\(\+[1-9]+[0-9]*\..*%\)/{f=1} END{exit f}' \ No newline at end of file +cargo bench --package reth-db --bench iai --manifest-path pr/Cargo.toml | tee /dev/tty | awk '/((L1)|(Ins)|(RAM)|(Est))+.*\(\+[1-9]+[0-9]*\..*%\)/{f=1} END{exit f}' \ No newline at end of file diff --git a/.github/workflows/bench.yml b/.github/workflows/bench.yml index 32464cbbe..005ff41ce 100644 --- a/.github/workflows/bench.yml +++ b/.github/workflows/bench.yml @@ -15,40 +15,45 @@ jobs: iai: runs-on: ubuntu-latest steps: - - name: Install Valgrind - run: | - sudo apt install valgrind + - name: Checkout main sources + uses: actions/checkout@v3 + with: + ref: main + path: main - name: Checkout PR sources uses: actions/checkout@v3 with: - ref: main + clean: false + path: pr + + - name: Install Valgrind + run: | + sudo apt install valgrind + + - name: Install toolchain + uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 with: + workspaces: | + main -> target + pr -> target cache-on-failure: true - name: Generate test vectors - uses: actions-rs/cargo@v1 - with: - command: run - args: --bin reth -- test-vectors tables + run: | + cargo run --bin reth --manifest-path main/Cargo.toml -- test-vectors tables + cp -r testdata main + mv testdata pr - name: Set main baseline - uses: actions-rs/cargo@v1 - with: - command: bench - args: --package reth-db --bench iai - - - name: Checkout main sources - uses: actions/checkout@v3 - with: - clean: false + run: cargo bench --package reth-db --bench iai --manifest-path main/Cargo.toml - name: Compare PR benchmark shell: 'script -q -e -c "bash {0}"' # required to workaround /dev/tty not being available run: | - ./.github/scripts/compare_iai.sh + ./pr/.github/scripts/compare_iai.sh # Checks that benchmarks not run in CI compile bench-check: diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3646fcab5..152148b04 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -64,10 +64,7 @@ jobs: flags: integration-tests sync: - name: sync / 100k blocks (${{ matrix.profile }}) - strategy: - matrix: - profile: [release, dev] + name: sync / 100k blocks runs-on: ubuntu-latest env: RUST_LOG: info,sync=error @@ -87,7 +84,7 @@ jobs: - name: Run sync (${{ matrix.profile }}) run: | - cargo run --profile ${{ matrix.profile }} \ + cargo run --profile release --features jemalloc,only-info-logs \ --bin reth -- node \ --debug.tip 0x91c90676cab257a59cd956d7cb0bceb9b1a71d79755c23c7277a0697ccfaf8c4 \ --debug.max-block 100000 \ diff --git a/.github/workflows/unit.yml b/.github/workflows/unit.yml index 7b8ecbdfd..3e5cb4544 100644 --- a/.github/workflows/unit.yml +++ b/.github/workflows/unit.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - partition: [1, 2, 3] + partition: [1, 2, 3, 4] steps: - name: Checkout sources uses: actions/checkout@v3