diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0639608..278ef45 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,10 +66,10 @@ jobs: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: postgres - # Use 1000 links for main/master branch benchmarks, 10 for pull requests - BENCHMARK_LINKS: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) && '1000' || '10' }} - # Use 100000 background links for main/master branch, 100 for pull requests - BENCHMARK_BACKGROUND_LINKS: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) && '100000' || '100' }} + # Use 100 links for main/master branch benchmarks, 10 for pull requests + BENCHMARK_LINKS: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) && '100' || '10' }} + # Use 1000 background links for main/master branch, 100 for pull requests + BENCHMARK_BACKGROUND_LINKS: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) && '1000' || '100' }} run: | set -o pipefail cargo bench --bench bench -- --output-format bencher | tee out.txt diff --git a/rust/src/lib.rs b/rust/src/lib.rs index 3743ea2..498a527 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -50,22 +50,22 @@ pub type Result> = result::Result usize { env::var("BENCHMARK_BACKGROUND_LINKS") .ok() .and_then(|s| s.parse().ok()) - .unwrap_or(3_000) + .unwrap_or(1_000) } /// Number of links to create/update/delete in each benchmark operation. /// Configurable via BENCHMARK_LINKS environment variable. -/// Default: 1000 (for local testing), CI uses 10 for PRs and 1000 for main branch. +/// Default: 100 (for local testing), CI uses 10 for PRs and 100 for main branch. pub fn benchmark_links() -> usize { env::var("BENCHMARK_LINKS") .ok() .and_then(|s| s.parse().ok()) - .unwrap_or(1_000) + .unwrap_or(100) } const PARAMS: &str = "user=postgres dbname=postgres password=postgres host=localhost port=5432";