Performances (fps) loss when removing UE_LOG(SomeVariable)
I'm currently creating a plugin. Everything is fine during my debugging, but when I start removing UE_LOG() that lies around, suddenly I get a huge performance hit, about 1/5 of the original performances.
I started by searching if something was broken but everything still works fine and without any bugs of any kind. So I put back some UE_LOG() to see from where the bug is originating. And the performances came back to normal... So I incrementally removed every UE_LOG() to see what's happening.
I found out that there are 2 places where performances disappear when the UE_LOG() are removed. But if one of them is removed but not the other, the performances are hurt by some amount,. When it is the other one that is removed, the performances are hurt by another amount. And if both are removed, the performances are even lower with another amount which doesn't seem to be the addition of both loss...
To make things even weirder, the UE_LOG() are displaying a variable which is a simple bool used as return value of a function. This is the same variable in both cases and this variable is only used once (outside the UE_LOG()) for a conditional.
The code is inside a FRunnableThread as a FRunnable and looks like that:
I tried to search for optimization problems but couldn't find anything. I tried used Sleep(0) to trigger event if any (via the scheduler).
As you can see, there is no obvious reason for that to happen.
If you have any clue about a possible reason and/or fix for this issue, please share it.
asked Apr 09 '19 at 10:29 AM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here