benchmark - slightly better stderr
This commit is contained in:
parent
b193d03151
commit
5ab6db2607
2 changed files with 4 additions and 4 deletions
|
@ -35,8 +35,8 @@ protected:
|
|||
public:
|
||||
test_case(mapnik::parameters const& params)
|
||||
: params_(params),
|
||||
threads_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("threads",0))),
|
||||
iterations_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("iterations",0)))
|
||||
threads_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("threads", 0))),
|
||||
iterations_(mapnik::safe_cast<std::size_t>(*params.get<mapnik::value_integer>("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<double>(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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue