Files
hakmem/core
Moe Charm (CI) 93e788bd52 Perf: Make diagnostic logging compile-time disabled in release builds
Optimization:
=============
Add HAKMEM_BUILD_RELEASE check to trc_refill_guard_enabled():
- Release builds (NDEBUG defined): Always return 0 (no logging)
- Debug builds: Check HAKMEM_TINY_REFILL_FAILFAST env var

This eliminates fprintf() calls and getenv() overhead in release builds.

Benchmark Results:
==================
Before: 1,015,347 ops/s
After:  1,046,392 ops/s
→ +3.1% improvement! 🚀

Perf Analysis (before fix):
- buffered_vfprintf: 4.90% CPU (fprintf overhead)
- hak_tiny_free_superslab: 52.63% (main hotspot)
- superslab_refill: 14.53%

Note: NDEBUG is not currently defined in Makefile, so
HAKMEM_BUILD_RELEASE=0 by default. Real gains will be
higher with -DNDEBUG in production builds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-08 01:46:37 +09:00
..