aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Göthel <[email protected]>2024-05-07 10:43:41 +0200
committerSven Göthel <[email protected]>2024-05-07 10:43:41 +0200
commit774e471548332b304f59a07c20053163765f78ac (patch)
treefe02d5b624d7e460f4af4ca308a398a96bfc6f98
parent464d5b17b268104347e9c38cb4ef98d4b7064687 (diff)
cpp_lang_util: Add inline constexpr const bool debug_enabled; test_math_mat4f_02_mul only issues 1M loops if debug_enabled
-rw-r--r--include/jau/cpp_lang_util.hpp6
-rw-r--r--test/test_math_mat4f_02_mul.cpp4
2 files changed, 8 insertions, 2 deletions
diff --git a/include/jau/cpp_lang_util.hpp b/include/jau/cpp_lang_util.hpp
index 5492bf6..dfe1904 100644
--- a/include/jau/cpp_lang_util.hpp
+++ b/include/jau/cpp_lang_util.hpp
@@ -778,6 +778,12 @@ namespace jau {
#endif
#endif
+ #if defined(NDEBUG) && !defined(DEBUG)
+ inline constexpr const bool debug_enabled = false;
+ #else
+ inline constexpr const bool debug_enabled = true;
+ #endif
+
/**@}*/
} // namespace jau
diff --git a/test/test_math_mat4f_02_mul.cpp b/test/test_math_mat4f_02_mul.cpp
index 9b7a937..1ada7fa 100644
--- a/test/test_math_mat4f_02_mul.cpp
+++ b/test/test_math_mat4f_02_mul.cpp
@@ -47,8 +47,8 @@ static const Mat4f m2(m2_0);
TEST_CASE( "Test 05 Perf01", "[mat4f][linear_algebra][math]" ) {
Mat4f res_m;
- const size_t warmups = 1000_u64;
- const size_t loops = 300_u64*1000000_u64;
+ const size_t warmups = debug_enabled ? 100_u64 : 1000_u64;
+ const size_t loops = debug_enabled ? 1_u64*1000000_u64 : 300_u64*1000000_u64;
jau::fraction_i64 tI4a = fractions_i64::zero;
jau::fraction_i64 tI4b = fractions_i64::zero;