Skip to content

chore: Refactor benchmarks#258

Merged
mhovd merged 9 commits into
mainfrom
new-benchmarks
May 14, 2026
Merged

chore: Refactor benchmarks#258
mhovd merged 9 commits into
mainfrom
new-benchmarks

Conversation

@mhovd
Copy link
Copy Markdown
Collaborator

@mhovd mhovd commented May 11, 2026

We need more meaningful benchmarks that actually test what we want to evaluate.

Copilot AI review requested due to automatic review settings May 11, 2026 18:16
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 11, 2026

🐰 Bencher Report

Branchnew-benchmarks
Testbedmhovd-pgx
Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
dsl/compile/1cpt-12h-po/analytical/dsl-jit📈 view plot
🚷 view threshold
59,853.00 ns
dsl/compile/1cpt-12h-po/ode/dsl-jit📈 view plot
🚷 view threshold
87,639.00 ns
dsl/compile/2cpt-120h-q12h/analytical/dsl-jit📈 view plot
🚷 view threshold
57,672.00 ns
dsl/compile/2cpt-120h-q12h/ode/dsl-jit📈 view plot
🚷 view threshold
113,610.00 ns
dsl/likelihood-matrix/1cpt-12h-po/analytical/dsl-jit📈 view plot
🚷 view threshold
915,170.00 ns
dsl/likelihood-matrix/1cpt-12h-po/ode/dsl-jit📈 view plot
🚷 view threshold
925,470.00 ns
dsl/likelihood-matrix/2cpt-120h-q12h/analytical/dsl-jit📈 view plot
🚷 view threshold
938,060.00 ns
dsl/likelihood-matrix/2cpt-120h-q12h/ode/dsl-jit📈 view plot
🚷 view threshold
940,160.00 ns
dsl/log-likelihood/1cpt-12h-po/analytical/dsl-jit/cold📈 view plot
🚷 view threshold
2,697.70 ns
dsl/log-likelihood/1cpt-12h-po/analytical/dsl-jit/hot📈 view plot
🚷 view threshold
782.11 ns
dsl/log-likelihood/1cpt-12h-po/ode/dsl-jit/cold📈 view plot
🚷 view threshold
25,329.00 ns
dsl/log-likelihood/1cpt-12h-po/ode/dsl-jit/hot📈 view plot
🚷 view threshold
777.73 ns
dsl/log-likelihood/2cpt-120h-q12h/analytical/dsl-jit/cold📈 view plot
🚷 view threshold
4,998.60 ns
dsl/log-likelihood/2cpt-120h-q12h/analytical/dsl-jit/hot📈 view plot
🚷 view threshold
1,040.30 ns
dsl/log-likelihood/2cpt-120h-q12h/ode/dsl-jit/cold📈 view plot
🚷 view threshold
92,868.00 ns
dsl/log-likelihood/2cpt-120h-q12h/ode/dsl-jit/hot📈 view plot
🚷 view threshold
978.51 ns
dsl/predictions/1cpt-12h-po/analytical/dsl-jit/cold📈 view plot
🚷 view threshold
2,410.30 ns
dsl/predictions/1cpt-12h-po/analytical/dsl-jit/hot📈 view plot
🚷 view threshold
2,493.70 ns
dsl/predictions/1cpt-12h-po/ode/dsl-jit/cold📈 view plot
🚷 view threshold
25,034.00 ns
dsl/predictions/1cpt-12h-po/ode/dsl-jit/hot📈 view plot
🚷 view threshold
25,007.00 ns
dsl/predictions/2cpt-120h-q12h/analytical/dsl-jit/cold📈 view plot
🚷 view threshold
4,572.30 ns
dsl/predictions/2cpt-120h-q12h/analytical/dsl-jit/hot📈 view plot
🚷 view threshold
4,520.20 ns
dsl/predictions/2cpt-120h-q12h/ode/dsl-jit/cold📈 view plot
🚷 view threshold
92,899.00 ns
dsl/predictions/2cpt-120h-q12h/ode/dsl-jit/hot📈 view plot
🚷 view threshold
93,732.00 ns
native/likelihood-matrix/1cpt-12h-po/analytical/handwritten📈 view plot
🚷 view threshold
936,200.00 ns
native/likelihood-matrix/1cpt-12h-po/analytical/macro📈 view plot
🚷 view threshold
941,320.00 ns
native/likelihood-matrix/1cpt-12h-po/ode/handwritten📈 view plot
🚷 view threshold
966,160.00 ns
native/likelihood-matrix/1cpt-12h-po/ode/macro📈 view plot
🚷 view threshold
953,790.00 ns
native/likelihood-matrix/2cpt-120h-q12h/analytical/handwritten📈 view plot
🚷 view threshold
939,660.00 ns
native/likelihood-matrix/2cpt-120h-q12h/analytical/macro📈 view plot
🚷 view threshold
935,050.00 ns
native/likelihood-matrix/2cpt-120h-q12h/ode/handwritten📈 view plot
🚷 view threshold
946,380.00 ns
native/likelihood-matrix/2cpt-120h-q12h/ode/macro📈 view plot
🚷 view threshold
947,330.00 ns
native/log-likelihood/1cpt-12h-po/analytical/handwritten/cold📈 view plot
🚷 view threshold
2,121.90 ns
native/log-likelihood/1cpt-12h-po/analytical/handwritten/hot📈 view plot
🚷 view threshold
835.18 ns
native/log-likelihood/1cpt-12h-po/analytical/macro/cold📈 view plot
🚷 view threshold
2,107.70 ns
native/log-likelihood/1cpt-12h-po/analytical/macro/hot📈 view plot
🚷 view threshold
837.50 ns
native/log-likelihood/1cpt-12h-po/ode/handwritten/cold📈 view plot
🚷 view threshold
22,345.00 ns
native/log-likelihood/1cpt-12h-po/ode/handwritten/hot📈 view plot
🚷 view threshold
768.94 ns
native/log-likelihood/1cpt-12h-po/ode/macro/cold📈 view plot
🚷 view threshold
22,400.00 ns
native/log-likelihood/1cpt-12h-po/ode/macro/hot📈 view plot
🚷 view threshold
779.99 ns
native/log-likelihood/2cpt-120h-q12h/analytical/handwritten/cold📈 view plot
🚷 view threshold
4,153.30 ns
native/log-likelihood/2cpt-120h-q12h/analytical/handwritten/hot📈 view plot
🚷 view threshold
1,003.60 ns
native/log-likelihood/2cpt-120h-q12h/analytical/macro/cold📈 view plot
🚷 view threshold
4,078.50 ns
native/log-likelihood/2cpt-120h-q12h/analytical/macro/hot📈 view plot
🚷 view threshold
991.59 ns
native/log-likelihood/2cpt-120h-q12h/ode/handwritten/cold📈 view plot
🚷 view threshold
83,968.00 ns
native/log-likelihood/2cpt-120h-q12h/ode/handwritten/hot📈 view plot
🚷 view threshold
992.66 ns
native/log-likelihood/2cpt-120h-q12h/ode/macro/cold📈 view plot
🚷 view threshold
84,942.00 ns
native/log-likelihood/2cpt-120h-q12h/ode/macro/hot📈 view plot
🚷 view threshold
993.25 ns
native/predictions/1cpt-12h-po/analytical/handwritten/cold📈 view plot
🚷 view threshold
1,796.80 ns
native/predictions/1cpt-12h-po/analytical/handwritten/hot📈 view plot
🚷 view threshold
1,829.60 ns
native/predictions/1cpt-12h-po/analytical/macro/cold📈 view plot
🚷 view threshold
1,810.80 ns
native/predictions/1cpt-12h-po/analytical/macro/hot📈 view plot
🚷 view threshold
1,815.60 ns
native/predictions/1cpt-12h-po/ode/handwritten/cold📈 view plot
🚷 view threshold
22,449.00 ns
native/predictions/1cpt-12h-po/ode/handwritten/hot📈 view plot
🚷 view threshold
354.08 ns
native/predictions/1cpt-12h-po/ode/macro/cold📈 view plot
🚷 view threshold
22,103.00 ns
native/predictions/1cpt-12h-po/ode/macro/hot📈 view plot
🚷 view threshold
393.50 ns
native/predictions/2cpt-120h-q12h/analytical/handwritten/cold📈 view plot
🚷 view threshold
3,865.90 ns
native/predictions/2cpt-120h-q12h/analytical/handwritten/hot📈 view plot
🚷 view threshold
4,074.90 ns
native/predictions/2cpt-120h-q12h/analytical/macro/cold📈 view plot
🚷 view threshold
3,939.10 ns
native/predictions/2cpt-120h-q12h/analytical/macro/hot📈 view plot
🚷 view threshold
3,928.20 ns
native/predictions/2cpt-120h-q12h/ode/handwritten/cold📈 view plot
🚷 view threshold
84,430.00 ns
native/predictions/2cpt-120h-q12h/ode/handwritten/hot📈 view plot
🚷 view threshold
569.78 ns
native/predictions/2cpt-120h-q12h/ode/macro/cold📈 view plot
🚷 view threshold
84,943.00 ns
native/predictions/2cpt-120h-q12h/ode/macro/hot📈 view plot
🚷 view threshold
571.99 ns
🐰 View full continuous benchmarking report in Bencher

Copy link
Copy Markdown
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 Criterion benchmark suite to focus on more representative end-to-end workloads (predictions, NCA, and population likelihood), while removing older micro/DSL-matrix benchmarks and tightening benchmark target configuration in Cargo.toml.

Changes:

  • Disable Cargo’s automatic benchmark discovery and explicitly define the benchmark targets that should be built/run.
  • Add new benchmarks for prediction generation and population likelihood (matrix + batch).
  • Simplify and consolidate the NCA benchmark to a fixed-size population run, and remove older benchmark files.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
Cargo.toml Disables autobenches and replaces the previous bench list with explicit predictions, nca, and likelihood targets.
benches/predictions.rs Adds a new benchmark covering analytical vs ODE prediction generation with cold/hot cache variants.
benches/nca.rs Refactors NCA benchmarks into a single grouped population benchmark with throughput + flat sampling.
benches/likelihood.rs Adds a new benchmark for log_likelihood_matrix and log_likelihood_batch population workloads.
benches/runtime_matrix.rs Removes the previous DSL runtime compile/predict benchmark matrix.
benches/performance.rs Removes the previous “readme”-style performance benchmark.
benches/ode.rs Removes the previous handwritten ODE benchmarks.
benches/likelihood_matrix.rs Removes the prior likelihood benchmark suite (breakdown + matrix/batch variants).
benches/data.rs Removes the previous dataset/builder operation benchmarks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread benches/likelihood.rs Outdated
Comment thread benches/likelihood.rs Outdated
Copy link
Copy Markdown
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

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Comment thread src/dsl/native.rs
Comment on lines +1824 to +1828
let key = (
subject.hash(),
crate::simulator::equation::spphash(support_point),
error_models.hash(),
);
Comment thread benches/common/mod.rs
Comment thread benches/dsl_matrix.rs
Comment thread benches/dsl_matrix.rs
Comment on lines +240 to +245
model
.estimate_predictions(
black_box(&subject),
black_box(&theta),
)
.unwrap(),
Comment thread src/dsl/native.rs
Comment on lines +1833 to +1839
let predictions = model.estimate_predictions(subject, support_point)?;
let log_lik = predictions.log_likelihood(error_models)?;
cache.insert(key, log_lik);
Ok(log_lik)
} else {
let predictions = model.estimate_predictions(subject, support_point)?;
predictions.log_likelihood(error_models)
Comment thread src/dsl/native.rs

let predictions = NativeSdeModel::estimate_predictions(self, subject, support_point)?;
let likelihood = match bound_error_models.as_ref() {
Some(error_models) => Some(predictions.log_likelihood(error_models)?.exp()),
@mhovd mhovd merged commit ead8c82 into main May 14, 2026
8 checks passed
This was referenced May 14, 2026
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.

3 participants