MCPcopy Create free account
hub / github.com/bcndev/bytecoin / pprint_benchmarks

Function pprint_benchmarks

tests/crypto/benchmarks.cpp:229–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

227//}
228
229void 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
244template<typename T, typename S>
245std::vector<std::pair<T, S>> mk_vec(std::vector<T> itemsT, std::vector<S> itemsS) {

Callers 1

benchmark_crypto_opsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected