From c855a82a4618f5f8d43240b423e6e4a2eab1c892 Mon Sep 17 00:00:00 2001 From: saschawillems Date: Sat, 26 Aug 2017 16:08:16 +0200 Subject: [PATCH] Small benchmark mode tweaks and fixes --- base/benchmark.hpp | 4 +--- bin/benchmark-all.py | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/base/benchmark.hpp b/base/benchmark.hpp index dc3faa06..c02bc867 100644 --- a/base/benchmark.hpp +++ b/base/benchmark.hpp @@ -26,8 +26,6 @@ namespace vks Benchmark() { active = true; - iterationTimes.resize(iterations); - #if defined(_WIN32) AttachConsole(ATTACH_PARENT_PROCESS); FILE *stream; @@ -37,7 +35,7 @@ namespace vks } void run(std::function renderFunc) { - static uint32_t currIteration; + iterationTimes.resize(iterations); for (uint32_t i = 0; i < iterations; i++) { for (uint32_t f = 0; f < framesPerIteration; f++) { auto tStart = std::chrono::high_resolution_clock::now(); diff --git a/bin/benchmark-all.py b/bin/benchmark-all.py index aebfc315..403feabb 100644 --- a/bin/benchmark-all.py +++ b/bin/benchmark-all.py @@ -72,9 +72,9 @@ os.makedirs("./benchmark", exist_ok=True) for example in EXAMPLES: print("---- (%d/%d) Running %s in benchmark mode ----" % (CURR_INDEX+1, len(EXAMPLES), example)) if platform.system() == 'Linux': - RESULT_CODE = subprocess.call("./%s %s ./benchmark/%s" % (example, ARGS, example), shell=True) + RESULT_CODE = subprocess.call("./%s %s ./benchmark/%s 5" % (example, ARGS, example), shell=True) else: - RESULT_CODE = subprocess.call("%s %s ./benchmark/%s" % (example, ARGS, example)) + RESULT_CODE = subprocess.call("%s %s ./benchmark/%s 5" % (example, ARGS, example)) if RESULT_CODE == 0: print("Results written to ./benchmark/%s.csv" % example) else: