From 67c9b825c2c66eeb2e56079c53240983e5a1ddd3 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Fri, 15 Mar 2024 14:27:39 -0700 Subject: [PATCH 1/2] Disable time tracking in wasm release builds because it's expensive --- src/mono/mono/mini/mini.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h index 70aab00b740f2..d8ea86aa34e25 100644 --- a/src/mono/mono/mini/mini.h +++ b/src/mono/mono/mini/mini.h @@ -2811,12 +2811,20 @@ void mono_cfg_add_try_hole (MonoCompile *cfg, MonoExceptionClause *clause, guint void mono_cfg_set_exception (MonoCompile *cfg, MonoExceptionType type); void mono_cfg_set_exception_invalid_program (MonoCompile *cfg, const char *msg); +#if defined(HOST_WASM) && !(defined(DEBUG) || defined(_DEBUG)) +#define MONO_TIME_TRACK(a, phase) \ + { \ + (phase) ; \ + a = 0; \ + } +#else #define MONO_TIME_TRACK(a, phase) \ { \ gint64 start = mono_time_track_start (); \ (phase) ; \ mono_time_track_end (&(a), start); \ } +#endif // HOST_WASM && !DEBUG gint64 mono_time_track_start (void); void mono_time_track_end (gint64 *time, gint64 start); From fd2edf2939458d288953fb17fbe12b472389e889 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Sat, 16 Mar 2024 04:04:03 -0700 Subject: [PATCH 2/2] Simplify ifdef --- src/mono/mono/mini/mini.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h index d8ea86aa34e25..781cb54b0492c 100644 --- a/src/mono/mono/mini/mini.h +++ b/src/mono/mono/mini/mini.h @@ -2811,7 +2811,7 @@ void mono_cfg_add_try_hole (MonoCompile *cfg, MonoExceptionClause *clause, guint void mono_cfg_set_exception (MonoCompile *cfg, MonoExceptionType type); void mono_cfg_set_exception_invalid_program (MonoCompile *cfg, const char *msg); -#if defined(HOST_WASM) && !(defined(DEBUG) || defined(_DEBUG)) +#if defined(HOST_WASM) #define MONO_TIME_TRACK(a, phase) \ { \ (phase) ; \ @@ -2824,7 +2824,7 @@ void mono_cfg_set_exception_invalid_program (MonoCompile *cfg, const char *msg); (phase) ; \ mono_time_track_end (&(a), start); \ } -#endif // HOST_WASM && !DEBUG +#endif // HOST_WASM gint64 mono_time_track_start (void); void mono_time_track_end (gint64 *time, gint64 start);