From 42747a1080ae7471f3b701037201ce25a4c99e96 Mon Sep 17 00:00:00 2001 From: "Moe Charm (CI)" Date: Fri, 28 Nov 2025 00:46:32 +0900 Subject: [PATCH] ENV Cleanup Step 3: Gate HAKMEM_TINY_PROFILE in tiny_fastcache.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Gate tiny_fast_profile_enabled() getenv call with HAKMEM_BUILD_RELEASE, returning 0 in release builds to disable profiling overhead. Performance: 30.34M ops/s (baseline: 30.2M) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- core/tiny_fastcache.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/tiny_fastcache.h b/core/tiny_fastcache.h index 36b604ad..2fa9f011 100644 --- a/core/tiny_fastcache.h +++ b/core/tiny_fastcache.h @@ -67,12 +67,16 @@ static inline uint64_t tiny_fast_rdtsc(void) { return 0; } extern int g_profile_enabled; static inline int tiny_fast_profile_enabled(void) { +#if !HAKMEM_BUILD_RELEASE extern int g_profile_enabled; if (__builtin_expect(g_profile_enabled == -1, 0)) { const char* env = getenv("HAKMEM_TINY_PROFILE"); g_profile_enabled = (env && *env && *env != '0') ? 1 : 0; } return g_profile_enabled; +#else + return 0; +#endif } // ========== Size to Class Mapping ==========