Remove remaining debug logs from hot paths
Additional debug overhead found during perf profiling: - hakmem_tiny.c:1798-1807: HAK_TINY_ALLOC_FAST_WRAPPER logs - hak_alloc_api.inc.h:85,91: Phase 7 failure logs Impact: - Before: 2.0M ops/s (100K iterations, logs enabled) - After: 8.67M ops/s (100K iterations, all logs disabled) - Improvement: +333% Remaining gap: Still 9.3x slower than System malloc (80.5M ops/s) Further investigation needed with perf profiling. Note: bench_random_mixed.c iteration logs also disabled locally (not committed, file is .gitignore'd) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -79,16 +79,20 @@ inline void* hak_alloc_at(size_t size, hak_callsite_t site) {
|
||||
// This prevents mixed HAKMEM/libc allocation bugs
|
||||
#if HAKMEM_TINY_HEADER_CLASSIDX
|
||||
if (!tiny_ptr && size <= TINY_MAX_SIZE) {
|
||||
#if !HAKMEM_BUILD_RELEASE
|
||||
// Tiny failed - log and continue to Mid/ACE (no early return!)
|
||||
static int log_count = 0;
|
||||
if (log_count < 3) {
|
||||
fprintf(stderr, "[DEBUG] Phase 7: tiny_alloc(%zu) failed, trying Mid/ACE layers (no malloc fallback)\n", size);
|
||||
log_count++;
|
||||
}
|
||||
#endif
|
||||
// Continue to Mid allocation below (do NOT fallback to malloc!)
|
||||
}
|
||||
#else
|
||||
#if !HAKMEM_BUILD_RELEASE
|
||||
static int log_count = 0; if (log_count < 3) { fprintf(stderr, "[DEBUG] tiny_alloc(%zu) returned NULL, falling back\n", size); log_count++; }
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user