Skip to content

Commit 707b41f

Browse files
authored
Merge pull request #18 from linksplatform/issue-17-1a453f4f4a81
Reduce benchmark link counts to prevent CI timeout
2 parents 8646b4d + 2bea65b commit 707b41f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

.github/workflows/rust.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ jobs:
6666
POSTGRES_USER: postgres
6767
POSTGRES_PASSWORD: postgres
6868
POSTGRES_DB: postgres
69-
# Use 1000 links for main/master branch benchmarks, 10 for pull requests
70-
BENCHMARK_LINKS: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) && '1000' || '10' }}
71-
# Use 100000 background links for main/master branch, 100 for pull requests
72-
BENCHMARK_BACKGROUND_LINKS: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) && '100000' || '100' }}
69+
# Use 100 links for main/master branch benchmarks, 10 for pull requests
70+
BENCHMARK_LINKS: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) && '100' || '10' }}
71+
# Use 1000 background links for main/master branch, 100 for pull requests
72+
BENCHMARK_BACKGROUND_LINKS: ${{ (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) && '1000' || '100' }}
7373
run: |
7474
set -o pipefail
7575
cargo bench --bench bench -- --output-format bencher | tee out.txt

rust/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,22 @@ pub type Result<T, E = Box<dyn error::Error + Sync + Send>> = result::Result<T,
5050

5151
/// Number of background links to create before each benchmark iteration.
5252
/// Configurable via BENCHMARK_BACKGROUND_LINKS environment variable.
53-
/// Default: 3000 (for local testing), CI uses 100 for PRs and 100000 for main branch.
53+
/// Default: 1000 (for local testing), CI uses 100 for PRs and 1000 for main branch.
5454
pub fn background_links() -> usize {
5555
env::var("BENCHMARK_BACKGROUND_LINKS")
5656
.ok()
5757
.and_then(|s| s.parse().ok())
58-
.unwrap_or(3_000)
58+
.unwrap_or(1_000)
5959
}
6060

6161
/// Number of links to create/update/delete in each benchmark operation.
6262
/// Configurable via BENCHMARK_LINKS environment variable.
63-
/// Default: 1000 (for local testing), CI uses 10 for PRs and 1000 for main branch.
63+
/// Default: 100 (for local testing), CI uses 10 for PRs and 100 for main branch.
6464
pub fn benchmark_links() -> usize {
6565
env::var("BENCHMARK_LINKS")
6666
.ok()
6767
.and_then(|s| s.parse().ok())
68-
.unwrap_or(1_000)
68+
.unwrap_or(100)
6969
}
7070
const PARAMS: &str = "user=postgres dbname=postgres password=postgres host=localhost port=5432";
7171

0 commit comments

Comments
 (0)