mirror of
https://github.com/facebook/zstd.git
synced 2025-08-01 09:47:01 +03:00
fix automated_benchmarking
make it able to process text output sent into either stdout or stderr
This commit is contained in:
@ -373,10 +373,7 @@ BMK_benchMemAdvancedNoAlloc(
|
|||||||
if (adv->mode == BMK_decodeOnly) {
|
if (adv->mode == BMK_decodeOnly) {
|
||||||
cSizes[nbBlocks] = thisBlockSize;
|
cSizes[nbBlocks] = thisBlockSize;
|
||||||
benchResult.cSize = thisBlockSize;
|
benchResult.cSize = thisBlockSize;
|
||||||
}
|
} } } }
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* warming up `compressedBuffer` */
|
/* warming up `compressedBuffer` */
|
||||||
if (adv->mode == BMK_decodeOnly) {
|
if (adv->mode == BMK_decodeOnly) {
|
||||||
|
@ -112,9 +112,9 @@ def parse_benchmark_output(output):
|
|||||||
def benchmark_single(executable, level, filename):
|
def benchmark_single(executable, level, filename):
|
||||||
return parse_benchmark_output((
|
return parse_benchmark_output((
|
||||||
subprocess.run(
|
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(" ")
|
.split(" ")
|
||||||
))
|
))
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ def benchmark(build, filenames, levels, iterations):
|
|||||||
def benchmark_dictionary_single(executable, filenames_directory, dictionary_filename, level, iterations):
|
def benchmark_dictionary_single(executable, filenames_directory, dictionary_filename, level, iterations):
|
||||||
cspeeds, dspeeds = [], []
|
cspeeds, dspeeds = [], []
|
||||||
for _ in range(iterations):
|
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)
|
cspeed, dspeed = parse_benchmark_output(output)
|
||||||
cspeeds.append(cspeed)
|
cspeeds.append(cspeed)
|
||||||
dspeeds.append(dspeed)
|
dspeeds.append(dspeed)
|
||||||
|
Reference in New Issue
Block a user