aboutsummaryrefslogtreecommitdiff
path: root/src/crates/candelabra
diff options
context:
space:
mode:
authorAria Shrimpton <me@aria.rip>2024-03-01 14:41:13 +0000
committerAria Shrimpton <me@aria.rip>2024-03-01 14:47:39 +0000
commit258f9112871570bd9d65359bd814d033374d302e (patch)
tree0a1b2c0a2c33884eea4365a35e14553509c8a545 /src/crates/candelabra
parent2f34cf8301e8d43840e7f26921cdd4e78a4ca6b0 (diff)
print all observations when running cost model benchmarks
Diffstat (limited to 'src/crates/candelabra')
-rw-r--r--src/crates/candelabra/src/cost/benchmark.rs20
-rw-r--r--src/crates/candelabra/src/cost/fit.rs2
2 files changed, 5 insertions, 17 deletions
diff --git a/src/crates/candelabra/src/cost/benchmark.rs b/src/crates/candelabra/src/cost/benchmark.rs
index a5ca042..6769ee1 100644
--- a/src/crates/candelabra/src/cost/benchmark.rs
+++ b/src/crates/candelabra/src/cost/benchmark.rs
@@ -45,17 +45,7 @@ pub type OpName = String;
pub type Observation = (usize, BenchmarkResult);
/// Results for a single benchmark
-#[derive(Serialize, Deserialize, Debug, Clone)]
-pub struct BenchmarkResult {
- /// The minimum cost
- pub min: Cost,
-
- /// The maximum cost
- pub max: Cost,
-
- /// The average (mean) cost
- pub avg: Cost,
-}
+pub type BenchmarkResult = f64;
/// Run benchmarks for the given container type, returning the results.
/// Panics if the given name is not in the library specs.
@@ -141,11 +131,9 @@ pub(crate) fn parse_criterion_output(
.strip_suffix(']')?
.split(' ');
- let result = BenchmarkResult {
- min: parse_time_str(timings.next()?, timings.next()?)?,
- avg: parse_time_str(timings.next()?, timings.next()?)?,
- max: parse_time_str(timings.next()?, timings.next()?)?,
- };
+ let _min = parse_time_str(timings.next()?, timings.next()?)?;
+ let result = parse_time_str(timings.next()?, timings.next()?)?;
+ // let _max = parse_time_str(timings.next()?, timings.next()?)?;
Some((name, result))
})
diff --git a/src/crates/candelabra/src/cost/fit.rs b/src/crates/candelabra/src/cost/fit.rs
index dada377..6160842 100644
--- a/src/crates/candelabra/src/cost/fit.rs
+++ b/src/crates/candelabra/src/cost/fit.rs
@@ -97,7 +97,7 @@ impl Estimator {
let xs = results.iter().map(|(n, _)| *n as f64).collect::<Vec<_>>();
let ys = OVector::<f64, Dyn>::from_iterator(
results.len(),
- results.iter().map(|(_, results)| results.avg),
+ results.iter().map(|(_, results)| *results),
);
(xs, ys)