From d6608adf60939647da09251350a33f76e225c451 Mon Sep 17 00:00:00 2001 From: Martins Mozeiko Date: Wed, 31 Jan 2024 20:02:11 -0800 Subject: [PATCH] make msvc release build much faster cl.exe for some reason spends unreasonable amount of time optimizing df_window_update_and_render function, we can use pragma to skip optimization for this function --- src/df/gfx/df_gfx.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/df/gfx/df_gfx.c b/src/df/gfx/df_gfx.c index 65911889..a7e5c8b6 100644 --- a/src/df/gfx/df_gfx.c +++ b/src/df/gfx/df_gfx.c @@ -1012,6 +1012,10 @@ df_window_from_os_handle(OS_Handle os) return result; } +#if defined(_MSC_VER) && !defined(__clang__) && defined(NDEBUG) +#pragma optimize("", off) +#endif + internal void df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, DF_CmdList *cmds) { @@ -6637,6 +6641,10 @@ df_window_update_and_render(Arena *arena, OS_EventList *events, DF_Window *ws, D ProfEnd(); } +#if defined(_MSC_VER) && !defined(__clang__) && defined(NDEBUG) +#pragma optimize("", on) +#endif + //////////////////////////////// //~ rjf: Eval Viz