]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
hsbench: output max throughput result
authorMatthew Barr <matthew.barr@intel.com>
Tue, 11 Apr 2017 04:27:59 +0000 (14:27 +1000)
committerMatthew Barr <matthew.barr@intel.com>
Tue, 30 May 2017 03:59:00 +0000 (13:59 +1000)
tools/hsbench/main.cpp

index 9eadf6dd78889da0ecb60d5623b46921fa985d06..b5506af3d9585ad0d9c976c63cb4ab5a5d16c5f1 100644 (file)
@@ -597,6 +597,17 @@ void displayPerScanResults(const vector<unique_ptr<ThreadContext>> &threads,
     printf("\n");
 }
 
+static
+double fastestResult(const vector<unique_ptr<ThreadContext>> &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<DataBlock> &corpus_blocks) {
     u64a total = 0;
@@ -650,8 +661,12 @@ void displayResults(const vector<unique_ptr<ThreadContext>> &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) {