The well-known wad that is affected by this bug is LSD. Inventory in this mod is made with ACS, and it lags heavily (drops to 1-2 fps) when it's open. Profiling showed that the performance bottleneck is exactly FWadCollection::GetLumpsInFolder.
Spoiler:https://github.com/coelckers/gzdoom/blo ... .cpp#L1344 - the part of code which makes lag