| 227 | //} |
| 228 | |
| 229 | void pprint_benchmarks(std::ostream &out, const std::map<std::string, BenchmarkResult> &benchmark_results) { |
| 230 | for (auto &tup : benchmark_results) { |
| 231 | auto &name = tup.first; |
| 232 | std::stringstream output; |
| 233 | double total_ms = tup.second.time_microsec / 1000.; // milliseconds |
| 234 | double total_s = total_ms / 1000.; // seconds |
| 235 | output << left << setw(6) << tup.second.count << " cycles " << right << setw(10) << std::fixed |
| 236 | << setprecision(3) << total_ms << " ms " << right << setw(7) << std::fixed << setprecision(3) |
| 237 | << total_ms / tup.second.count << " ms/op " << right << setw(7) << int(tup.second.count / total_s) |
| 238 | << " op/s " << left << name << endl; |
| 239 | out << output.str(); |
| 240 | } |
| 241 | out << "internal suffix=" << int(global_result) << endl; // so compiler cannot optimize calcs out |
| 242 | } |
| 243 | |
| 244 | template<typename T, typename S> |
| 245 | std::vector<std::pair<T, S>> mk_vec(std::vector<T> itemsT, std::vector<S> itemsS) { |
no outgoing calls
no test coverage detected