FWadCollection::GetLumpsInFolder performance problems

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: FWadCollection::GetLumpsInFolder performance problems

Re: FWadCollection::GetLumpsInFolder performance problems

by Graf Zahl » Sun Oct 20, 2019 6: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.

Re: FWadCollection::GetLumpsInFolder performance problems

by _mental_ » Wed Sep 25, 2019 11:09 pm

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.

Re: FWadCollection::GetLumpsInFolder performance problems

by UsernameAK » Wed Sep 25, 2019 2: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.

Re: FWadCollection::GetLumpsInFolder performance problems

by _mental_ » Mon Sep 23, 2019 3: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.

Re: FWadCollection::GetLumpsInFolder performance problems

by Graf Zahl » Fri Sep 20, 2019 11:21 am

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.

Re: FWadCollection::GetLumpsInFolder performance problems

by UsernameAK » Fri Sep 20, 2019 10: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.

Re: FWadCollection::GetLumpsInFolder performance problems

by Rachael » Fri Sep 20, 2019 9:50 am

Maybe GZDoom should cache the error state of font creations so that it does not continue attempting this?

Re: FWadCollection::GetLumpsInFolder performance problems

by _mental_ » Fri Sep 20, 2019 8:39 am

It calls ACS SetFont with non-existing font named NORMAL. GZDoom tries to create it every tick.

Re: FWadCollection::GetLumpsInFolder performance problems

by Graf Zahl » Fri Sep 20, 2019 7:18 am

What crazy stuff does this mod do to trigger such an edge case?

FWadCollection::GetLumpsInFolder performance problems

by UsernameAK » Fri Sep 20, 2019 6: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 74 times

Top