DEV Community

CharmPic
CharmPic

Posted on

I suffered a crushing defeat against mimalloc in specific tuning scenarios.

  1. The Scalability Wall (T=16) At 16 threads, hz3 hit a limit.

hz3: 76.6M ops/s

mimalloc: 85.0M ops/s

hz4 (AI): 106.3M ops/s My allocator struggles to scale linearly at high thread counts compared to the AI's brute-force approach.

  1. The "Aggressive Purge" Defeat In the default benchmarks, hz3 used less memory (1.36GB) than mimalloc (1.52GB). However, when we enabled mimalloc's aggressive memory release mode (purge_delay=0), the tables turned dramatically.

mimalloc (tuned): 0.52 GB 😱

hz3 (tuned): 1.39 GB

Result: hz3 used 2.7x more memory.

mimalloc has a highly sophisticated page reclaiming system that I haven't implemented yet. While hz3 holds onto memory to keep speed up, mimalloc can strip down to the bare metal when asked. This is a clear victory for mimalloc's engineering maturity.

Top comments (0)