# Performance ## Record cache in widened views (`src/mods/recordcache.cpp`) Measured 2026-10-15 (Battlemage save in a town, frame time at Flip, sampling profiler over all threads): walking took 90-130 ms per frame in the widened view, 17 ms with widescreen off; idle 17 ms in both. The render thread spent most samples in a std::map walk (0x832b80 / 0x832ba0, called from 0x636222) inside FUN_006360e0: a record-by-id cache (map at +0xde5c, size at +0xde60, 16-byte value at node +0x14, last-used stamp at node +0x24 from 0xcd59d0; misses read the record from the file at +0x23c). With 4096 entries or more, every insert walks the whole map to erase the single least recently used entry. The widened view needs more records than that, so walking evicted and reloaded constantly. Fix: the limit (`cmp ecx, 1000h` at 0x636201) is raised to 0x8000 so the per-insert walk never runs; before a lookup with 0x6000 entries the mod erases the less recently used half in one pass (map::erase 0x63da10). Walking in town: 17 ms per frame again (confirmed by the user).