From 5ab6db26079c5b51bc920392eb3a75b4242a2347 Mon Sep 17 00:00:00 2001 From: Artem Pavlenko Date: Wed, 10 Jan 2018 10:04:10 +0000 Subject: [PATCH] benchmark - slightly better stderr --- benchmark/bench_framework.hpp | 6 +++--- benchmark/run | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/benchmark/bench_framework.hpp b/benchmark/bench_framework.hpp index 4cc9390e8..32639ed85 100644 --- a/benchmark/bench_framework.hpp +++ b/benchmark/bench_framework.hpp @@ -35,8 +35,8 @@ protected: public: test_case(mapnik::parameters const& params) : params_(params), - threads_(mapnik::safe_cast(*params.get("threads",0))), - iterations_(mapnik::safe_cast(*params.get("iterations",0))) + threads_(mapnik::safe_cast(*params.get("threads", 0))), + iterations_(mapnik::safe_cast(*params.get("iterations", 0))) {} std::size_t threads() const { @@ -240,7 +240,7 @@ int run(T const& test_runner, std::string const& name) big_number_fmt ips(5, total_iters / seconds(elapsed_nonzero).count()); std::snprintf(msg, sizeof(msg), - "%-43s %3zu threads %*.0f%s iters %6.0f milliseconds %*.0f%s i/s\n", + "%-43s %3zu thread(s) %*.0f%s iters %6.0f milliseconds %*.0f%s i/s\n", name.c_str(), num_threads, itersf.w, itersf.v, itersf.u, diff --git a/benchmark/run b/benchmark/run index 36cda4e92..b296fc8ce 100755 --- a/benchmark/run +++ b/benchmark/run @@ -10,7 +10,7 @@ function run { local threads="$2" local iters="$3" shift 3 - $runner --threads 0 --iterations $iters "$@" + $runner --threads 1 --iterations $iters "$@" if test $threads -gt 0; then $runner --threads $threads --iterations $((iters/threads)) "$@" fi