Skip to content

refactor: change benchmark sample sizes to 10k-100k#16

Merged
Neclow merged 4 commits intosbhattlab:mainfrom
Neclow:bench_sample_sizes
May 1, 2025
Merged

refactor: change benchmark sample sizes to 10k-100k#16
Neclow merged 4 commits intosbhattlab:mainfrom
Neclow:bench_sample_sizes

Conversation

@Neclow
Copy link
Collaborator

@Neclow Neclow commented May 1, 2025

No description provided.

@Neclow Neclow requested a review from Copilot May 1, 2025 10:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the benchmark sample sizes for phylo2vec to use fixed multiples of 10,000, resulting in sample sizes ranging from 10k to 100k, and updates the Criterion configuration accordingly.

  • Updated SAMPLE_SIZES from a power-of-2 range to a multiplier-based range.
  • Converted sample size calculation from 2^i to 10000 * i.
  • Increased the Criterion sample size from 10 to 30.
Comments suppressed due to low confidence (1)

phylo2vec/benches/benchmarks/core.rs:75

  • [nitpick] Verify that the increased sample size setting for benchmark iterations (30 instead of 10) provides statistically reliable results without causing excessive benchmark run times.
.sample_size(30)

Neclow and others added 3 commits May 1, 2025 12:48
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Neclow Neclow requested a review from Copilot May 1, 2025 10:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors benchmark tests by changing sample size ranges from powers-of-two to fixed sizes between 10k and 100k, and adjusts the Rust benchmark configuration to use a higher Criterion sample size.

  • Updated Python benchmarks to use a BIG_RANGE constant
  • Refactored import alias from _phylo2vec_core to core in Python tests
  • Modified the Rust benchmark to use a RangeInclusive multiplier with sample sizes scaled by 10,000 and increased Criterion’s sample_size from 10 to 30

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
py-phylo2vec/benchmarks/test_bench.py Updated sample size range and import alias for benchmarking tests
phylo2vec/benches/benchmarks/core.rs Changed benchmark sample size calculations and adjusted Criterion's sample size
Comments suppressed due to low confidence (1)

py-phylo2vec/benchmarks/test_bench.py:5

  • [nitpick] Consider renaming the alias 'core' to something like 'p2v_core' to better reflect the module's purpose and maintain consistency with previous naming.
from phylo2vec import _phylo2vec_core as core

@@ -73,7 +76,7 @@ fn bench_to_vector(c: &mut Criterion) {
criterion_group! {
name = core;
config = Criterion::default()
Copy link

Copilot AI May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment explaining the rationale for increasing the sample_size to 30 to aid future maintainers in understanding the performance trade-offs.

Suggested change
config = Criterion::default()
config = Criterion::default()
// Set sample_size to 30 to balance statistical accuracy with reasonable execution time.

Copilot uses AI. Check for mistakes.
@Neclow Neclow merged commit 0a5a396 into sbhattlab:main May 1, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants