From: Matthew Barr Date: Tue, 11 Apr 2017 04:27:59 +0000 (+1000) Subject: hsbench: output max throughput result X-Git-Tag: v4.5.0^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85358e0ad08ecdc8a5aad116d33ee9bfcbcb616a;p=thirdparty%2Fvectorscan.git hsbench: output max throughput result --- diff --git a/tools/hsbench/main.cpp b/tools/hsbench/main.cpp index 9eadf6dd..b5506af3 100644 --- a/tools/hsbench/main.cpp +++ b/tools/hsbench/main.cpp @@ -597,6 +597,17 @@ void displayPerScanResults(const vector> &threads, printf("\n"); } +static +double fastestResult(const vector> &threads) { + double best = threads[0]->results[0].seconds; + for (const auto &t : threads) { + for (const auto &r : t->results) { + best = min(best, r.seconds); + } + } + return best; +} + static u64a byte_size(const vector &corpus_blocks) { u64a total = 0; @@ -650,8 +661,12 @@ void displayResults(const vector> &threads, double blockRate = (double)totalBlocks / (double)totalSecs; printf("Overall block rate: %'0.2f blocks/sec\n", blockRate); - printf("Overall throughput: %'0.2Lf Mbit/sec\n", + printf("Mean throughput: %'0.2Lf Mbit/sec\n", calc_mbps(totalSecs, totalBytes)); + + double lowestScanTime = fastestResult(threads); + printf("Maximum throughput: %'0.2Lf Mbit/sec\n", + calc_mbps(lowestScanTime, bytesPerRun)); printf("\n"); if (display_per_scan) {