monobench: don't sort the Bench vector while iterating through it...
authorMike Klein <mtklein@chromium.org>
Thu, 5 Jan 2017 19:23:57 +0000 (14:23 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 5 Jan 2017 20:00:26 +0000 (20:00 +0000)
commitef6bbbd06374cf7ef175c780ec9ac87c43386532
tree8c02cb6b815f0d52340960bec4400404237c879b
parent7c6bc4616cee740b197e4e8f2b704b3f55fd8e6d
monobench: don't sort the Bench vector while iterating through it...

We sort to display Bench results in an ascending order, but we're doing this while iterating through the bench vector.  This is probably undefined, and really screws up the sample distribution in practice.  Slow benches run more often.

Instead, copy the results of the benches to a new Result vector to sort and display.  Each bench now gets its fair share of samples.

Change-Id: I4ead0d9d69af271c9971eedb35604a4b3bca0784
Reviewed-on: https://skia-review.googlesource.com/6623
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Herb Derby <herb@google.com>
Commit-Queue: Mike Klein <mtklein@chromium.org>
tools/monobench.cpp