summaryrefslogtreecommitdiffstats
path: root/source/core/slang-performance-profiler.cpp
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2025-07-17 14:59:33 +0800
committerGitHub <noreply@github.com>2025-07-17 06:59:33 +0000
commit28758e0e427ceca196937dc90efe3ab1cb35bd70 (patch)
tree7a609525e686772854d8cd82b7a91f69a97c0e30 /source/core/slang-performance-profiler.cpp
parent020a16072923a66ae0985be618fd32310aa87242 (diff)
Perf improvements to IR serialization (#7751)
* option to use riff as serialization backend * option to use riff as serialization backend * perf * shuffle code * perf improvements to deserialization * formatting * remove bit_cast * correct IR verification * neaten serialized format * fix peek module info * formatting * remove temporary profiling code * cleanup * fix wasm build * more explicit sizes * deserialize via fossil on 32 bit wasm * Make serialized modules Int size agnostic * reorder stable names to allow range based check for 64 bit constants * format * review comments * fix build * fix * c++17 compat slang-common.h
Diffstat (limited to 'source/core/slang-performance-profiler.cpp')
-rw-r--r--source/core/slang-performance-profiler.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/core/slang-performance-profiler.cpp b/source/core/slang-performance-profiler.cpp
index 9bc532680..bd046f4cc 100644
--- a/source/core/slang-performance-profiler.cpp
+++ b/source/core/slang-performance-profiler.cpp
@@ -35,15 +35,22 @@ public:
char buffer[512];
for (const auto& func : data)
{
- 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"
- << static_cast<uint64_t>(milliseconds.count()) << "ms\n";
+ auto microseconds =
+ std::chrono::duration_cast<std::chrono::microseconds>(func.value.duration);
+ double milliseconds = microseconds.count() / 1000.0;
+ snprintf(
+ buffer,
+ sizeof(buffer),
+ "[*] %30s \t%d \t%8.2fms\n",
+ func.key,
+ func.value.invocationCount,
+ milliseconds);
+
+ out << buffer;
}
}
+
+
virtual void clear() override { data.clear(); }
virtual void dispose() override { data = decltype(data)(); }
};