From f4ff4236e1eb80a8274b219d6e4c3813c15be9cd Mon Sep 17 00:00:00 2001 From: venkataram-nv Date: Tue, 13 Aug 2024 11:44:19 -0700 Subject: GitHub action benchmark (#4804) Adds a new Github CI action for benchmarking the slangc compiler on the MDL shaders. For now, the results are only dumped to the output of the CI, which can be later viewed through raw logs. The next step is to use github-action-benchmark to push these results into a page which will show the benchmark results over time as commits are pushed. --- source/core/slang-performance-profiler.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/core/slang-performance-profiler.cpp') diff --git a/source/core/slang-performance-profiler.cpp b/source/core/slang-performance-profiler.cpp index b480e1c8e..f08b4998d 100644 --- a/source/core/slang-performance-profiler.cpp +++ b/source/core/slang-performance-profiler.cpp @@ -31,11 +31,14 @@ namespace Slang } virtual void getResult(StringBuilder& out) override { - for (auto func : data) + char buffer[512]; + for (const auto& func : data) { - out << func.key << ": \t"; + memset(buffer, 0, sizeof(buffer)); + snprintf(buffer, sizeof(buffer), "[*] %30s", func.key); + out << buffer << " \t"; auto milliseconds = std::chrono::duration_cast< std::chrono::milliseconds >(func.value.duration); - out << func.value.invocationCount << "\t" << milliseconds.count() << "ms\n"; + out << func.value.invocationCount << " \t" << milliseconds.count() << "ms\n"; } } virtual void clear() override -- cgit v1.2.3