diff --git a/.github/actions/keynote-bench-setup/action.yml b/.github/actions/keynote-bench-setup/action.yml index 95eb487e0f0..8fa03d744f7 100644 --- a/.github/actions/keynote-bench-setup/action.yml +++ b/.github/actions/keynote-bench-setup/action.yml @@ -19,6 +19,15 @@ runs: shell: bash run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Enable sccache + shell: bash + run: | + echo "SCCACHE_GHA_ENABLED=true" >>"$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >>"$GITHUB_ENV" + - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 737b7e18c3f..148979c886b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,6 +110,15 @@ jobs: - name: Set default rust toolchain run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Enable sccache + shell: bash + run: | + echo "SCCACHE_GHA_ENABLED=true" >>"$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >>"$GITHUB_ENV" + - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 with: @@ -428,16 +437,24 @@ jobs: - name: Set default rust toolchain run: rustup default $(rustup show active-toolchain | cut -d' ' -f1) + - name: Set up sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Enable sccache + run: | + echo "SCCACHE_GHA_ENABLED=true" >>"$GITHUB_ENV" + echo "RUSTC_WRAPPER=sccache" >>"$GITHUB_ENV" + - name: Cache Rust dependencies uses: Swatinem/rust-cache@v2 with: workspaces: ${{ github.workspace }} - shared-key: spacetimedb - save-if: false + shared-key: spacetimedb-index-scan + cache-on-failure: false prefix-key: v1 - name: Run index scan benchmark regression check - run: cargo bench -p spacetimedb-bench --bench index_scan_gate + run: cargo run --release -p spacetimedb-index-scan-gate lints: needs: [merge_queue_noop] diff --git a/Cargo.lock b/Cargo.lock index 1db7622f17f..3187ad56920 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8555,6 +8555,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "spacetimedb-index-scan-gate" +version = "2.7.0" +dependencies = [ + "anyhow", + "spacetimedb-sats", + "spacetimedb-testing", + "tikv-jemallocator", +] + [[package]] name = "spacetimedb-lib" version = "2.7.0" diff --git a/Cargo.toml b/Cargo.toml index 61f8080c7d2..842332340d8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ members = [ "crates/expr", "crates/guard", "crates/fs-utils", + "crates/index-scan-gate", "crates/lib", "crates/metrics", "crates/paths", diff --git a/crates/bench/Cargo.toml b/crates/bench/Cargo.toml index ea8d4960227..115eb115022 100644 --- a/crates/bench/Cargo.toml +++ b/crates/bench/Cargo.toml @@ -30,10 +30,6 @@ harness = false name = "index" harness = false -[[bench]] -name = "index_scan_gate" -harness = false - [[bin]] name = "summarize" diff --git a/crates/index-scan-gate/Cargo.toml b/crates/index-scan-gate/Cargo.toml new file mode 100644 index 00000000000..0a9edae7b10 --- /dev/null +++ b/crates/index-scan-gate/Cargo.toml @@ -0,0 +1,17 @@ +[package] +name = "spacetimedb-index-scan-gate" +version.workspace = true +edition.workspace = true +license-file = "../../licenses/BSL.txt" +publish = false + +[dependencies] +anyhow.workspace = true +spacetimedb-sats.workspace = true +spacetimedb-testing = { path = "../testing" } + +[target.'cfg(not(target_env = "msvc"))'.dependencies] +tikv-jemallocator.workspace = true + +[lints] +workspace = true diff --git a/crates/bench/benches/index_scan_gate.rs b/crates/index-scan-gate/src/main.rs similarity index 98% rename from crates/bench/benches/index_scan_gate.rs rename to crates/index-scan-gate/src/main.rs index a03977f61ed..0ab2882b2c8 100644 --- a/crates/bench/benches/index_scan_gate.rs +++ b/crates/index-scan-gate/src/main.rs @@ -1,3 +1,5 @@ +#![allow(clippy::disallowed_macros)] + use std::time::Duration; use anyhow::{bail, Context, Result};