wip: test logging performance issues

Summary:

Test Plan:
This commit is contained in:
icex2 2025-01-19 21:50:05 +01:00
parent 3d868e33d4
commit 8ec9ec712c
6 changed files with 17 additions and 11 deletions

View File

@ -30,7 +30,7 @@ void hdr_mutex_free(struct hdr_mutex* mutex)
#endif
#include <windows.h>
#include <WinSock2.h>
#include <winsock2.h>
int hdr_mutex_init(struct hdr_mutex* mutex)
{

View File

@ -116,15 +116,17 @@ static int log_thread_proc(void *ctx)
static void
log_post(char level, const char *module, const char *fmt, va_list ap)
{
if (WaitForSingleObject(log_rv_producer, INFINITE)) {
return;
}
// TODO test if this addresses performance issues and stuttering
// TODO measure time how long waiting takes here?
// if (WaitForSingleObject(log_rv_producer, INFINITE)) {
// return;
// }
log_rv_level = level;
log_rv_module = module;
str_vformat(log_rv_buffer, sizeof(log_rv_buffer), fmt, ap);
// log_rv_level = level;
// log_rv_module = module;
// str_vformat(log_rv_buffer, sizeof(log_rv_buffer), fmt, ap);
ReleaseSemaphore(log_rv_consumer, 1, NULL);
// ReleaseSemaphore(log_rv_consumer, 1, NULL);
}
#define LOG_POST_IMPL(name, level) \

View File

@ -261,7 +261,8 @@ skip:
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
{
if (reason == DLL_PROCESS_ATTACH) {
log_to_writer(log_writer_debug, NULL);
// TODO switched to null writer to see if it addresses performance issues
log_to_writer(log_writer_null, NULL);
/* Bootstrap hook for further init tasks (see above) */

View File

@ -254,7 +254,8 @@ skip:
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
{
if (reason == DLL_PROCESS_ATTACH) {
log_to_writer(log_writer_debug, NULL);
// TODO switched to null writer to see if it addresses performance issues
log_to_writer(log_writer_null, NULL);
/* Bootstrap hook for further init tasks (see above) */

View File

@ -246,7 +246,8 @@ skip:
BOOL WINAPI DllMain(HMODULE mod, DWORD reason, void *ctx)
{
if (reason == DLL_PROCESS_ATTACH) {
log_to_writer(log_writer_debug, NULL);
// TODO switched to null writer to see if it addresses performance issues
log_to_writer(log_writer_null, NULL);
/* Bootstrap hook for further init tasks (see above) */

View File

@ -1,6 +1,7 @@
dlls += iidxio-perf
ldflags_iidxio-perf := \
-lws2_32
libs_iidxio-perf := \
hdr-histogram \