Download

Anyone met unstable fps?

I’ve met a strange problem with fps/deltaTime. Somewhy it’s not stable and dropped ten times each 1-2 seconds. I’ve logged DeltaTime, and it looks like:


Log: time: 0.011001
Log: time: 0.011381
Log: time: 0.011340
Log: time: 0.091389
Log: time: 0.008333
Log: time: 0.008333
Log: time: 0.008333

Anyone met it? :slight_smile:

You can use the profiler and the ‘stat hitches’ to help track this down, some info in this post:
https://answers.unrealengine.com/questions/2845/gameplay-profiler.html

Thanks, James. I’ve used commands to make dumps, and common hitch looks like:


[2014.04.17-07.26.44:171][416]LogStats2: ------------------Thread Hitch, Frame 2415    79.6ms ---------------
[2014.04.17-07.26.44:187][417]LogStats2: ------------------ Render Thread (RenderThread///Thread_1f98_0///) 79.61ms
[2014.04.17-07.26.44:187][417]LogStats2:   79.54ms (  57)  -  Thread_1f98_0 - RenderThread
[2014.04.17-07.26.44:187][417]LogStats2:     67.14ms (  17)  -  CPU Stall - Wait For Event - STAT_EventWait - STATGROUP_CPUStalls
[2014.04.17-07.26.44:187][417]LogStats2:     10.69ms (   1)  -  SlateDrawWindowsCommand - SlateDrawWindowsCommand - STATGROUP_RenderThreadCommands
[2014.04.17-07.26.44:187][417]LogStats2:       10.67ms (   1)  -  Present time - STAT_D3D11PresentTime - STATGROUP_D3D11RHI
[2014.04.17-07.26.44:187][417]LogStats2:          9.62ms (   1)  -  RenderQuery Result - STAT_RenderQueryResultTime - STATGROUP_SceneRendering
[2014.04.17-07.26.44:187][417]LogStats2:          1.05ms (   1)  -  Self
[2014.04.17-07.26.44:187][417]LogStats2:        0.02ms (   2)  -  OtherChildren
[2014.04.17-07.26.44:187][417]LogStats2:      1.57ms (   1)  -  FDrawSceneCommand - FDrawSceneCommand - STATGROUP_RenderThreadCommands
[2014.04.17-07.26.44:187][417]LogStats2:        1.57ms (   1)  -  RenderViewFamily - STAT_TotalSceneRenderingTime - STATGROUP_SceneRendering
[2014.04.17-07.26.44:187][417]LogStats2:          1.57ms (  62)  -  OtherChildren
[2014.04.17-07.26.44:187][417]LogStats2:      0.14ms (  38)  -  OtherChildren
[2014.04.17-07.26.44:187][417]LogStats2: ------------------ Game Thread 79.32ms
[2014.04.17-07.26.44:187][417]LogStats2:   79.31ms (   3)  -  Thread_990_0 - GameThread
[2014.04.17-07.26.44:187][417]LogStats2:     79.31ms (   2)  -  FrameTime - STAT_FrameTime - STATGROUP_Engine
[2014.04.17-07.26.44:187][417]LogStats2:       78.30ms (   1)  -  Deferred Tick Time - STAT_DeferredTickTime - STATGROUP_Engine
[2014.04.17-07.26.44:187][417]LogStats2:         76.53ms (   1)  -  Self
[2014.04.17-07.26.44:187][417]LogStats2:         1.77ms (15656)  -  CPU Stall - Sleep - STAT_Sleep - STATGROUP_CPUStalls
[2014.04.17-07.26.44:187][417]LogStats2:        1.01ms (   8)  -  OtherChildren

It happens even on empty scene with default set of pawn/hud/controller/etc., so I definitely sure that problem is not caused by my code.

Why CPU Stall can happen so often? I’ve tried it on two diffenet computers and got the same behaviour. Also, real fps doesn’t look as it was dropped for ten times, it mostly affects DeltaTime value (f.e. DeltaTime == ~0.8 when this hitch happened).

Also I’ve surprized to see the 10ms for SlateDrawWindowsCommand, because I’m not using Slate.

Maybe it will be helpful, but first hitch looks a bit different: http://pastebin.com/jbJhnKQq

Hitch is here:
76.66ms ( 1) - Deferred Tick Time - STAT_DeferredTickTime - STATGROUP_Engine

This was fixed in 4.1, the problem was in querying android devices every 5 secs on a game thread. You can fix it temporally by removing ANDROID_HOME environment variable. But don’t forget to restore it once you update to 4.1 :slight_smile:

Great to hear that :slight_smile: Thanks.