aboutsummaryrefslogtreecommitdiff
path: root/src/crates/cli/src/select.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/crates/cli/src/select.rs')
-rw-r--r--src/crates/cli/src/select.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/crates/cli/src/select.rs b/src/crates/cli/src/select.rs
index bb613f5..740b988 100644
--- a/src/crates/cli/src/select.rs
+++ b/src/crates/cli/src/select.rs
@@ -26,8 +26,8 @@ impl State {
let costs = self.inner.rank_candidates(proj).unwrap();
let mut builder = Builder::default();
- builder.set_header(["name", "implementation", "estimated cost"]);
- for (con_type_name, candidates) in costs.iter() {
+ builder.set_header(["name", "implementation", "estimated cost", "file"]);
+ for (f, ctn, candidates) in costs.iter() {
for (candidate, cost) in candidates.iter() {
let name = match candidate {
Selection::Singular(x) => x.to_string(),
@@ -39,9 +39,10 @@ impl State {
}
};
builder.push_record([
- con_type_name.as_str(),
+ ctn.as_str(),
name.as_str(),
cost.to_string().as_str(),
+ f.as_str(),
]);
}
}
@@ -57,15 +58,24 @@ impl State {
.inner
.project_candidate_list(proj)?
.into_iter()
- .flat_map(|(_, v)| v.into_iter())
+ .map(|(f, ctn, v)| ((f, ctn), v))
.collect();
let possible_assignments = nary_cartesian_product(&candidates);
+
let mut assignments_results = HashMap::new();
for assignment in possible_assignments.iter() {
info!("Running benchmarks with {:?}", &assignment);
assignments_results.insert(
format!("{:?}", &assignment),
- self.inner.run_benchmarks_with(proj, assignment)?,
+ self.inner.run_benchmarks_with(
+ proj,
+ &assignment
+ .into_iter()
+ .map(|((f, ctn), i)| {
+ (f.clone(), ctn.clone(), Selection::Singular(i.to_string()))
+ })
+ .collect(),
+ )?,
);
}