Use mimalloc for host allocations #1487
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1487"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by FIocker on 2026-11-28T20:44:00Z.
Uses mimalloc for the host allocator and keeps allocation counters in diagnostics builds. This is an independent port of the allocator change from HotScarlett, with attribution in the commit.
In an earlier matched local build, the allocator-only comparison moved the median from 34.9 to 34.1 ms in the 6,500–8,500 draw window on one machine. This is a component result. The rebased branch awaits CI and gameplay validation.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by POMXARK on 2026-11-28T21:47:49Z.
@FIocker — here is a full 20-minute gameplay A/B on Windows 11 (RTX 5080 16 GB, Ryzen 7 5700X 8C/16T, 32 GB RAM, Series X 1440p, DLSS Quality + MFG 4x, release build, matched save & switches):
20-minute A/B (
mimalloc 0.1.52vs Windows system heap)mimalloc)prep 48.8 ms)prep 44.5 ms)-4.3 ms)prep 51.5 ms)prep 59.9 ms)+8.4 ms)prep 64.9 ms)prep 68.5 ms)+3.6 ms)67.4 ms)70.5 ms)steps 28.3 ms)steps 32.6 ms)>100ms(5s bins)Takeaway
1k–4kdraws, before memory pressure),mimallocgave a clean +7.5% FPS / -4.3 ms prep win with 0 errors and clean visuals.mimalloc's default per-thread segment retention added +1,124 MB peak commit (30.9 -> 32.1 GB) and +787 MB WS, pushing heavier4k–7k/7k–10kscenes deeper into commit/paging pressure and causing a net regression overall (14.80 -> 14.20 FPS).MIMALLOC_PURGE_DELAY=10/mi_option_set(mi_option_purge_delay, 10)or callingmi_collect(false)under host memory pressure) so 16–32 GB systems keep the fast-pathmimallocspeedup without the ~1.1 GB extra commit footprint.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by amazedturnip on 2026-11-29T05:38:28Z.
Running mimalloc as default allocator on 9800X3D + RTX 5070 Ti 16 GB (32 GB RAM, Windows 11) across several gameplay sessions and full shader pretranslations. Clean build, zero allocator crashes or regressions.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by JSa25 on 2026-11-30T10:12:25Z.
An independent measurement of mimalloc as the global allocator, in case it helps this along. Hardware and profile: RTX 5090, Ryzen 9 9950X3D, Series X profile, 2560x1440 with DLSS Quality, frame generation off, ray tracing off.
Method:
scripts/bench.ps1, the camera turning between the window and the room).Why it helps here: before the change, a
VICTORY_PROFILEsample of 60 s of that route put about a fifth of victory-submit's time in the Windows heap (20-23% at the top of its list). With mimalloc, allocation was gone from the top of the list.Our version:
mimallocas the#[global_allocator]behind a cargo feature (mimalloc, off by default), forwarded from the app to victory-hle and victory-gpu.Caveats: one PC, a CPU-bound scene, and a diagnostics build. Where the GPU is the limit the gain should be smaller.