From 1b548f1ba3d18395ac3a741ab136054e2a1e9e43 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 7 Sep 2025 13:59:06 +0300 Subject: [PATCH] Profile tasks execution in async::threadpool --- libs/async/CMakeLists.txt | 6 +++++- libs/async/source/threadpool.cpp | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/async/CMakeLists.txt b/libs/async/CMakeLists.txt index d911e5fc..97977802 100644 --- a/libs/async/CMakeLists.txt +++ b/libs/async/CMakeLists.txt @@ -3,4 +3,8 @@ file(GLOB_RECURSE PSEMEK_ASYNC_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "s psemek_add_library(psemek-async ${PSEMEK_ASYNC_HEADERS} ${PSEMEK_ASYNC_SOURCES}) target_include_directories(psemek-async PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include") -target_link_libraries(psemek-async PUBLIC psemek-log psemek-util) +target_link_libraries(psemek-async PUBLIC + psemek-log + psemek-util + psemek-prof +) diff --git a/libs/async/source/threadpool.cpp b/libs/async/source/threadpool.cpp index c4501f7f..81f8d8eb 100644 --- a/libs/async/source/threadpool.cpp +++ b/libs/async/source/threadpool.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include @@ -32,6 +33,7 @@ namespace psemek::async try { + prof::profiler prof("task"); task(); } catch (util::exception const & e)