(results: &[&FetchLocalRunBenchmarkResult])
| 132 | } |
| 133 | |
| 134 | fn build_simulation_table(results: &[&FetchLocalRunBenchmarkResult]) -> String { |
| 135 | let rows: Vec<SimulationRow> = results |
| 136 | .iter() |
| 137 | .map(|result| { |
| 138 | let (instructions, cache, memory, sys_time) = result |
| 139 | .valgrind |
| 140 | .as_ref() |
| 141 | .and_then(|v| v.time_distribution.as_ref()) |
| 142 | .map(|td| { |
| 143 | let total = result.value; |
| 144 | let ir_pct = (td.ir / total) * 100.0; |
| 145 | let l1m_pct = (td.l1m / total) * 100.0; |
| 146 | let llm_pct = (td.llm / total) * 100.0; |
| 147 | ( |
| 148 | format_distribution_pct(ir_pct), |
| 149 | format_distribution_pct(l1m_pct), |
| 150 | format_distribution_pct(llm_pct), |
| 151 | helpers::format_duration(td.sys, Some(2)), |
| 152 | ) |
| 153 | }) |
| 154 | .unwrap_or_else(|| { |
| 155 | ( |
| 156 | "-".to_string(), |
| 157 | "-".to_string(), |
| 158 | "-".to_string(), |
| 159 | "-".to_string(), |
| 160 | ) |
| 161 | }); |
| 162 | |
| 163 | SimulationRow { |
| 164 | name: result.benchmark.name.clone(), |
| 165 | time: format!( |
| 166 | "{}", |
| 167 | style(helpers::format_duration(result.value, Some(2))).cyan() |
| 168 | ), |
| 169 | instructions, |
| 170 | cache, |
| 171 | memory, |
| 172 | sys_time, |
| 173 | } |
| 174 | }) |
| 175 | .collect(); |
| 176 | build_table_with_style( |
| 177 | &rows, |
| 178 | ExecutorName::Valgrind.label(), |
| 179 | ExecutorName::Valgrind.icon(), |
| 180 | ) |
| 181 | } |
| 182 | |
| 183 | fn build_walltime_table(results: &[&FetchLocalRunBenchmarkResult]) -> String { |
| 184 | let rows: Vec<WalltimeRow> = results |
no test coverage detected