]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
test-zstd-speed.py: fixed checking of ratio limit
authorinikep <inikep@gmail.com>
Mon, 25 Jul 2016 08:35:53 +0000 (10:35 +0200)
committerinikep <inikep@gmail.com>
Mon, 25 Jul 2016 08:35:53 +0000 (10:35 +0200)
tests/test-zstd-speed.py

index a70a9585e16f92e7a3a70bdeca7693fa8e16022a..d2bf75a61c0e4a0d6540dc4c98d153d4803ca227 100755 (executable)
@@ -134,13 +134,13 @@ def benchmark_and_compare(branch, commit, args, resultsFileName, testFilePath, f
         commit, csize, cspeed, dspeed = get_last_results(resultsFileName)
         text = ""
         for i in range(0, min(len(cspeed), len(last_cspeed))):
-            print("%s:%s -%d cSpeed=%6.2f cLast=%6.2f cDiff=%1.4f dSpeed=%6.2f dLast=%6.2f dDiff=%1.4f ratioDiff=%1.4f %s" % (branch, commit, i+1, cspeed[i], last_cspeed[i], cspeed[i]/last_cspeed[i], dspeed[i], last_dspeed[i], dspeed[i]/last_dspeed[i], float(csize[i])/last_csize[i], fileName))
+            print("%s:%s -%d cSpeed=%6.2f cLast=%6.2f cDiff=%1.4f dSpeed=%6.2f dLast=%6.2f dDiff=%1.4f ratioDiff=%1.4f %s" % (branch, commit, i+1, cspeed[i], last_cspeed[i], cspeed[i]/last_cspeed[i], dspeed[i], last_dspeed[i], dspeed[i]/last_dspeed[i], float(last_csize[i])/csize[i], fileName))
             if (cspeed[i]/last_cspeed[i] < args.lowerLimit):
                 text += "WARNING: -%d cSpeed=%.2f cLast=%.2f cDiff=%.4f %s\n" % (i+1, cspeed[i], last_cspeed[i], cspeed[i]/last_cspeed[i], fileName)
             if (dspeed[i]/last_dspeed[i] < args.lowerLimit):
                 text += "WARNING: -%d dSpeed=%.2f dLast=%.2f dDiff=%.4f %s\n" % (i+1, dspeed[i], last_dspeed[i], dspeed[i]/last_dspeed[i], fileName)
-            if (float(csize[i])/last_csize[i] < args.ratioLimit):
-                text += "WARNING: -%d cSize=%d last_cSize=%d diff=%.4f %s\n" % (i+1, csize[i], last_csize[i], float(csize[i])/last_csize[i], fileName)
+            if (float(last_csize[i])/csize[i] < args.ratioLimit):
+                text += "WARNING: -%d cSize=%d last_cSize=%d diff=%.4f %s\n" % (i+1, csize[i], last_csize[i], float(last_csize[i])/csize[i], fileName)
         if text:
             text = args.message + ("\nmaxLoadAvg=%s  load average at start=%s end=%s\n" % (args.maxLoadAvg, start_load, end_load)) + text
         return text