Mutagen-Modding / Mutagen

A .NET library for analyzing, creating, and manipulating Bethesda mods
GNU General Public License v3.0
123 stars 32 forks source link

LinkCache.WinningOverride calls #558

Open Noggog opened 1 month ago

Noggog commented 1 month ago

linkCache.PriorityOrder.WinningOverrides() The .PriorityOrder style winning overrides has been the goto standard. But that's from the days of synthesis patchers, which typically loop over all the records once and do whatever

But for repeated calls, this redoes a lot of work, as it's just working off IEnumerable, it has to look for and construct the winning overrides each call. This means accessing the related group (which hits the disk) foreach mod, and then constructing the set to find which ones are the winning overrides. The disk hit especially isn't great

If the linkCache itself offered the call: linkCache.WinningOverrides() it could then fulfill it via the actual cache (rather than the IEnumerable member, which cannot) Subsequent calls would then be a near instant fulfillment