A_RemoveLight causes severe lag on high detail maps

Is there something that doesn't work right in the latest GZDoom? Post about it here.

Moderator: GZDoom Developers

Forum rules
Please construct and post a simple demo whenever possible for all bug reports. Please provide links to everything.

If you can include a wad demonstrating the problem, please do so. Bug reports that include fully-constructed demos have a much better chance of being investigated in a timely manner than those that don't.

Please make a new topic for every bug. Don't combine multiple bugs into a single topic. Thanks!

A_RemoveLight causes severe lag on high detail maps

Postby Marisa Kirisame » Fri Oct 02, 2020 2:06 am

Discovered this accidentally while playing my mod recently. I have a certain projectile that manually attaches a light to itself, then removes it on death (mainly because it uses the same sprite and frame on both spawn and death, so I can't simply use gldefs to assign it).

The following file is a stripped down version of that projectile. Typing "summon loveheart" in any map with lots of complex geometry (this even includes Frozen Time, so there's that for a test), and waiting for the projectile to hit something, you'll notice gzdoom will freeze for a while, every time. It appears that the slowdown happens somewhere in FDynamicLight::CollectWithinRadius (a_dynlight.cpp line 356).
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_RemoveLight causes severe lag on high detail maps

Postby Major Cooke » Fri Oct 02, 2020 2:36 pm

Curious. Does it lag more if you just deactivate the light in particular?
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: A_RemoveLight causes severe lag on high detail maps

Postby Marisa Kirisame » Sat Oct 03, 2020 3:42 am

The lag is ONLY caused by removing that specific light the projectile attaches to itself.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_RemoveLight causes severe lag on high detail maps

Postby Rachael » Sat Oct 03, 2020 6:40 am

What happens if you deactivate, and then remove the light? (Just going on a haunch here)
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_RemoveLight causes severe lag on high detail maps

Postby Marisa Kirisame » Sat Oct 03, 2020 9:15 am

It's not possible to deactivate the light if it's handled through AttachLight.

There's no function for that.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_RemoveLight causes severe lag on high detail maps

Postby Graf Zahl » Sat Oct 17, 2020 4:46 am

I cannot reproduce any slowdown, not even in a debug build.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A_RemoveLight causes severe lag on high detail maps

Postby Marisa Kirisame » Sat Oct 17, 2020 6:02 am

Guess it fixed itself, can't reproduce it either.

Edit: Nevermind, it happened again, seems to be entirely random. In most cases it only happens on specific launches.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: A_RemoveLight causes severe lag on high detail maps

Postby Graf Zahl » Sat Oct 17, 2020 6:11 am

Are you even sure it's really the light and not a random coincidence?

This looks more like a garbage collection related problem. From the looks of it that projectile is spawning quite a bit of effects actors.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: A_RemoveLight causes severe lag on high detail maps

Postby Marisa Kirisame » Sat Oct 17, 2020 1:10 pm

Considering that I don't see the issue ever happen if I get rid of the light attach/remove, I doubt it's the effect actors. I spawn boatloads of those in the mod proper and there are no issues with that.
User avatar
Marisa Kirisame
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: 霧雨魔理沙#1666
Twitch ID: magusmarisa
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support


Return to Bugs

Who is online

Users browsing this forum: No registered users and 0 guests