]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fix automated_benchmarking
authorYann Collet <yann.collet.73@gmail.com>
Sun, 12 Sep 2021 08:36:18 +0000 (01:36 -0700)
committerYann Collet <yann.collet.73@gmail.com>
Sun, 12 Sep 2021 08:36:18 +0000 (01:36 -0700)
make it able to process text output sent into either stdout or stderr

programs/benchzstd.c
tests/automated_benchmarking.py

index 2366cf2d7c0d9ca7ad80b13a76262da47b9ca280..c7675057f67cbf25e41dc37f7318f19f21c7fb13 100644 (file)
@@ -373,10 +373,7 @@ BMK_benchMemAdvancedNoAlloc(
                 if (adv->mode == BMK_decodeOnly) {
                     cSizes[nbBlocks] = thisBlockSize;
                     benchResult.cSize = thisBlockSize;
-                }
-            }
-        }
-    }
+    }   }   }   }
 
     /* warming up `compressedBuffer` */
     if (adv->mode == BMK_decodeOnly) {
index bd995b198efb7361a1b78e988f600b79b90c7046..e6da9024418a513df1c718bf401ba1cbb45c97e7 100644 (file)
@@ -112,9 +112,9 @@ def parse_benchmark_output(output):
 def benchmark_single(executable, level, filename):
     return parse_benchmark_output((
         subprocess.run(
-            [executable, "-qb{}".format(level), filename], stderr=subprocess.PIPE
+            [executable, "-qb{}".format(level), filename], stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
         )
-        .stderr.decode("utf-8")
+        .stdout.decode("utf-8")
         .split(" ")
     ))
 
@@ -145,7 +145,7 @@ def benchmark(build, filenames, levels, iterations):
 def benchmark_dictionary_single(executable, filenames_directory, dictionary_filename, level, iterations):
     cspeeds, dspeeds = [], []
     for _ in range(iterations):
-        output = subprocess.run([executable, "-qb{}".format(level), "-D", dictionary_filename, "-r", filenames_directory], stderr=subprocess.PIPE).stderr.decode("utf-8").split(" ")
+        output = subprocess.run([executable, "-qb{}".format(level), "-D", dictionary_filename, "-r", filenames_directory], stdout=subprocess.PIPE).stdout.decode("utf-8").split(" ")
         cspeed, dspeed = parse_benchmark_output(output)
         cspeeds.append(cspeed)
         dspeeds.append(dspeed)