MCPcopy Create free account
hub / github.com/bshoshany/thread-pool / print_speedup

Function print_speedup

tests/BS_thread_pool_test.cpp:3161–3167  ·  view source on GitHub ↗

* @brief Calculate and print the speedup obtained by multithreading. * * @param timings A vector of the timings corresponding to different numbers of tasks. * @param try_tasks A vector containing the numbers of tasks tried. */

Source from the content-addressed store, hash-verified

3159 * @param try_tasks A vector containing the numbers of tasks tried.
3160 */
3161void print_speedup(const std::vector<double>& timings, const std::vector<std::size_t>& try_tasks)
3162{
3163 const std::size_t min_el = min_element_index(timings);
3164 const double max_speedup = std::round((timings[0] / timings[min_el]) * 10) / 10;
3165 const std::size_t num_tasks = try_tasks[min_el];
3166 logln("Maximum speedup obtained by multithreading vs. single-threading: ", max_speedup, "x, using ", num_tasks, " tasks.");
3167}
3168
3169/**
3170 * @brief Calculate the mean and standard deviation of a set of integers.

Callers 1

check_performanceFunction · 0.85

Calls 2

min_element_indexFunction · 0.85
loglnFunction · 0.85

Tested by

no test coverage detected