Updating instances in a function which is looped with a timer is killing fps
I have this function:
It is called by a timer every 0.1 seconds:
The function is updating 500 instances. Unfortunately, this is decreasing the fps extremely. The stats look like this:
But the stats are wrong, I get something like 2 fps. The stats don't even make sense, since either GPU or Game has to be equal to the frame time. So, I get 2 fps.
If I disconnect the timer and instead run the function every tick:
Then the fps should be even worse, but no, they are not! With running the function every tick, which is more often than 10 times a second, I get this stats:
And these stats are correct, it's running smoothly with ~30 fps. So the GrowTree function is called 30 times a second instead of 10 times with the timer, but the fps are 100 times better.
Does not make sense. So there has to be a bug with the timer.
asked Apr 30 '15 at 07:34 PM in Bug Reports
Hi John Alcatraz,
I have been able to reproduce this on my end and have entered a bug report, UE-14819 to be assessed by the development staff.
answered May 01 '15 at 02:51 PM
There may be a few things gs going on.
I would put a print statement in the function as its called and one when it completes. what happens if the function is called again before it completes.
This is an area you may want to put into C++ but you will still potentially have undefined behavior if you are modifying the contents of a list simultaneously. Regardless of the fps inconsistenvies I'd expect other bugs as well if that loop is run again before it completes the first time. If it is in series and is waiting to complete there is your blocking behavior.
answered Apr 30 '15 at 07:58 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here