[Won't change] FWadCollection::GetLumpsInFolder performance problems

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

FWadCollection::GetLumpsInFolder performance problems

Postby UsernameAK » Fri Sep 20, 2019 7:56 am

FWadCollection::GetLumpsInFolder makes lag because it basically bruteforces all lumps in all wads. It affects performance of wads that use ACS SetFont heavily and have large amount of lumps.
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
Attachments
lsd-v1.2.2-gzfix.pk3
LSD gzdoom compat patch if you need some testing thingy. the lsd itself is in the spoiler
(666 Bytes) Downloaded 4 times
User avatar
UsernameAK
Cat
 
Joined: 15 Jul 2015
Location: Ukraine
Discord: /bin/cat#8891

Re: FWadCollection::GetLumpsInFolder performance problems

Postby Graf Zahl » Fri Sep 20, 2019 8:18 am

What crazy stuff does this mod do to trigger such an edge case?
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: FWadCollection::GetLumpsInFolder performance problems

Postby _mental_ » Fri Sep 20, 2019 9:39 am

It calls ACS SetFont with non-existing font named NORMAL. GZDoom tries to create it every tick.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: FWadCollection::GetLumpsInFolder performance problems

Postby Rachael » Fri Sep 20, 2019 10:50 am

Maybe GZDoom should cache the error state of font creations so that it does not continue attempting this?
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: FWadCollection::GetLumpsInFolder performance problems

Postby UsernameAK » Fri Sep 20, 2019 11:15 am

The texture really exists. It's in gzdoom.pk3's graphics folder. That weird trick is used to use mouse in older ports.
User avatar
UsernameAK
Cat
 
Joined: 15 Jul 2015
Location: Ukraine
Discord: /bin/cat#8891

Re: FWadCollection::GetLumpsInFolder performance problems

Postby Graf Zahl » Fri Sep 20, 2019 12:21 pm

This looks more like an error in the font checking code, it shouldn't try to recreate a font if something with the name is found.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: FWadCollection::GetLumpsInFolder performance problems

Postby _mental_ » Mon Sep 23, 2019 4:33 am

UsernameAK wrote:The texture really exists. It's in gzdoom.pk3's graphics folder.

Where is this texture exactly? Also, querying FWADCollection and FTextureManager for it returns nothing.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: FWadCollection::GetLumpsInFolder performance problems

Postby UsernameAK » Wed Sep 25, 2019 3:51 pm

_mental_ wrote:
UsernameAK wrote:The texture really exists. It's in gzdoom.pk3's graphics folder.

Where is this texture exactly? Also, querying FWADCollection and FTextureManager for it returns nothing.

Oh, i was wrong. It really doesn't exist. If you put some stub texture, it stops lagging.
User avatar
UsernameAK
Cat
 
Joined: 15 Jul 2015
Location: Ukraine
Discord: /bin/cat#8891

Re: FWadCollection::GetLumpsInFolder performance problems

Postby _mental_ » Thu Sep 26, 2019 12:09 am

The simplest solution seems to be a removal of this condition. So, empty font will be created regardless of texture existence, and lumps lookup will happen only once.
_mental_
 
 
 
Joined: 07 Aug 2011

Re: FWadCollection::GetLumpsInFolder performance problems

Postby Graf Zahl » Sun Oct 20, 2019 7:40 am

V_GetFont must not create placeholders, it would break the entire font system. This is simply bad use. The CheckFont ACS function exists for good reasons.
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany


Return to Closed Bugs

Who is online

Users browsing this forum: _mental_ and 2 guests