github suprepupre/wow-optimize v2.0.7
v2.0.7 — Heap Optimization + Debug String Skip + Memory Purge

latest release: v2.0.8
5 hours ago

⚡ Three System-Level Optimizations

All three are pure Win32/runtime improvements — zero addon/Lua impact, no semantic changes.

1. Low Fragmentation Heap (LFH)

WoW uses Win32 HeapAlloc/HeapFree for some allocations that bypass the CRT malloc/free we already replaced with mimalloc. The default Windows heap algorithm fragments badly over long play sessions (2+ hours), causing growing memory footprint and allocation stalls.

Fix: Enable Microsoft's Low Fragmentation Heap on:

  • The process default heap (GetProcessHeap)
  • All heaps created via HeapCreate

LFH is optimized for frequent small allocations — exactly what WoW does. Zero semantic change — same pointers, same sizes, just faster and less fragmented.

Expected effect: Fewer microstutters in long sessions, especially in raids and cities.

2. OutputDebugStringA — Skip When No Debugger

WoW calls OutputDebugStringA for internal debug logging. Without a debugger attached, each call is a wasted kernel transition (~5-10 microseconds). This adds up with heavy addon usage.

Fix: Skip the call entirely when IsDebuggerPresent() returns false. If a debugger is attached, debug output works normally.

Expected effect: Slightly lower CPU overhead per frame, especially with debug-heavy addon configurations.

3. Periodic mimalloc Memory Purge

Every ~4096 frames (~68 seconds at 60fps), call mi_collect() to return unused memory pages to the OS. This helps with:

  • Reducing memory pressure after loading screens
  • Preventing gradual memory bloat during long sessions
  • Keeping the working set tight for better cache behavior

Summary

Feature What It Does
LFH Better heap algorithm for all WoW heaps
Debug skip Eliminate useless kernel transitions
Memory purge Return unused pages to OS periodically

Full Changelog

v2.0.6...v2.0.7

Don't miss a new wow-optimize release

NewReleases is sending notifications on new releases.