Phase 35-39: FAST build optimization complete (+7.13% cumulative)
Phase 35-A: BENCH_MINIMAL gate function elimination (GO +4.39%) - tiny_front_v3_enabled() → constant true - tiny_metadata_cache_enabled() → constant 0 - learner_v7_enabled() → constant false - small_learner_v2_enabled() → constant false Phase 36: Policy snapshot init-once (GO +0.71%) - small_policy_v7_snapshot() version check skip in BENCH_MINIMAL - TLS cache for policy snapshot Phase 37: Standard TLS cache (NO-GO -0.07%) - TLS cache for Standard build attempted - Runtime gate overhead negates benefit Phase 38: FAST/OBSERVE/Standard workflow established - make perf_fast, make perf_observe targets - Scorecard and documentation updates Phase 39: Hot path gate constantization (GO +1.98%) - front_gate_unified_enabled() → constant 1 - alloc_dualhot_enabled() → constant 0 - g_bench_fast_front, g_v3_enabled blocks → compile-out - free_dispatch_stats_enabled() → constant false Results: - FAST v3: 56.04M ops/s (47.4% of mimalloc) - Standard: 53.50M ops/s (45.3% of mimalloc) - M1 target (50%): 5.5% remaining 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#ifndef HAK_FREE_API_INC_H
|
||||
#define HAK_FREE_API_INC_H
|
||||
|
||||
#include "../hakmem_build_flags.h" // Phase 39: HAKMEM_BENCH_MINIMAL (GO +1.98%)
|
||||
#include <sys/mman.h> // For mincore() in AllocHeader safety check
|
||||
#include "hakmem_tiny_superslab.h" // For SUPERSLAB_MAGIC, SuperSlab
|
||||
#include "../ptr_trace.h" // Debug: pointer trace immediate dump on libc fallback
|
||||
@ -112,6 +113,8 @@ void hak_free_at(void* ptr, size_t size, hak_callsite_t site) {
|
||||
#endif
|
||||
// Bench-only ultra-short path: try header-based tiny fast free first
|
||||
// Enable with: HAKMEM_BENCH_FAST_FRONT=1
|
||||
// Phase 39: BENCH_MINIMAL → compile-out (GO +1.98%)
|
||||
#if !HAKMEM_BENCH_MINIMAL
|
||||
{
|
||||
static int g_bench_fast_front = -1;
|
||||
if (__builtin_expect(g_bench_fast_front == -1, 0)) {
|
||||
@ -129,6 +132,7 @@ void hak_free_at(void* ptr, size_t size, hak_callsite_t site) {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!ptr) {
|
||||
#if HAKMEM_DEBUG_TIMING
|
||||
@ -168,7 +172,8 @@ void hak_free_at(void* ptr, size_t size, hak_callsite_t site) {
|
||||
case FG_DOMAIN_TINY: {
|
||||
// Phase FREE-FRONT-V3-2: v3 snapshot routing (optional, default OFF)
|
||||
// Optimized: No tiny_route_for_class() calls, no redundant ENV checks
|
||||
#if HAKMEM_TINY_HEADER_CLASSIDX
|
||||
// Phase 39: BENCH_MINIMAL → compile-out (GO +1.98%)
|
||||
#if HAKMEM_TINY_HEADER_CLASSIDX && !HAKMEM_BENCH_MINIMAL
|
||||
{
|
||||
// Check if v3 snapshot routing is enabled (cached)
|
||||
static int g_v3_enabled = -1;
|
||||
|
||||
Reference in New Issue
Block a user