Performance of Replay in 4.12

Hey guys,

Just updated my project from 4.11 to 4.12 and now my packaged game runs very choppy. I dug into it, and it seems as though the issue is with serializing replay frames. I used ‘stat dumphitches’ and it showed me a call stack like:

LogStats:   61.720ms (   4)  -  Thread_352c_0 - GameThread
LogStats:     61.714ms (   2)  -  FrameTime - STAT_FrameTime 
LogStats:       61.399ms (   1)  -  GameEngine Tick - STAT_GameEngineTick
LogStats:         60.835ms (   1)  -  World Tick Time - STAT_WorldTickTime
LogStats:           58.786ms (   1)  -  GT Tickable Time - STAT_TickableTickTime
LogStats:             58.778ms (   1)  -  **FNullNetworkReplayStreamer**
LogStats:             0.008ms (   6)  -  OtherChildren

I also fired up VerySleepy to get a second opinion and it says I was spending all my time writing JSON to file. So the two seem to agree with each other, but I’m not sure where to go from here.

Thoughts?

,

  • Are there any logs you’re able to obtain for me?
  • Please send me the link of your project running in 4.11 and 4.12 for comparison?
  • Is this happening when you create a new project in 4.12 using JSON?
  • What browser are you working in?

Looking forward to hearing back from you, thanks! :slight_smile:

Okay! I was able to reproduce the issue in a blank project.

Steps:

  1. Create a new C++ project using the 3rd person template, on Windows, with 4.12. (Which I hope also answers your questions about what ‘browser’ I’m using … this isn’t a web project.)

  2. I added:

    void AReplayTest_4_12GameMode::HandleMatchHasStarted()
    {
    Super::HandleMatchHasStarted();
    UGameplayStatics::GetGameInstance(GetWorld())->StartRecordingReplay(TEXT(“”), TEXT(“My Replay”));
    }
    To GameMode so that a replay starts recording on Play.

  3. Cooked and built the project, ran from Visual Studio, and got the same choppiness from before.

I’ve included the logs from that run here: Replay Stalling in Unreal 4.12 - Pastebin.com

I’ll try the same experiment again with 4.11 and see what happens.

Yup, confirmed. I made a new 4.11 project with the same setup and it locked in a solid 60FPS. Here’s the logs from that run: Unreal Smooth Run in 4.11 - Pastebin.com

If I don’t enable replay in the 4.12 version, I rock 60+ FPS. So it’s clearly something wonky going on with the replay recording in 4.12.

,

Thanks for verifying you were using Windows, I assumed when you said JSON in your original post. Haha.

So I have created the third person template exactly as you have suggested, I created one without the code and also a blueprint one to compare.

These are the types of numbers my computer is running with:

4.12.5

LogStats:   333.288ms (   4)  -  Thread_2fb4_0 - GameThread - STATGROUP_Threads - STATCAT_Advanced
LogStats:     333.278ms (   2)  -  FrameTime - STAT_FrameTime - STATGROUP_Engine - STATCAT_Advanced
LogStats:       319.104ms (   1)  -  STAT_FEngineLoop_UpdateTimeAndHandleMaxTickRate - STATGROUP_Quick - STATCAT_Advanced
LogStats:         319.093ms (   1)  -  Game thread tick wait time - STAT_GameTickWaitTime - STATGROUP_Threading - STATCAT_Advanced
LogStats:           319.093ms (   1)  -  Game thread idle time - STAT_GameIdleTime - STATGROUP_Threading - STATCAT_Advanced
LogStats:           0.000ms (   1)  -  OtherChildren

4.11.2

LogStats:   333.305ms (   4)  -  Thread_18a8_0 - GameThread - STATGROUP_Threads - STATCAT_Advanced
LogStats:     333.303ms (   2)  -  FrameTime - STAT_FrameTime - STATGROUP_Engine - STATCAT_Advanced
LogStats:       322.976ms (   1)  -  STAT_FEngineLoop_UpdateTimeAndHandleMaxTickRate - STATGROUP_Quick - STATCAT_Advanced
LogStats:         322.966ms (   1)  -  Game thread tick wait time - STAT_GameTickWaitTime - STATGROUP_Threading - STATCAT_Advanced
LogStats:           322.965ms (   1)  -  Game thread idle time - STAT_GameIdleTime - STATGROUP_Threading - STATCAT_Advanced
LogStats:         0.009ms (   1)  -  OtherChildren

When we’re discussing your actual project. Does the game lag/hitch or does it completely freeze up? Does the screen seem to shake, or anything like that?

Looking forward to hearing back from you - thanks!

Re: Your stats: Were you running at 3FPS? Anyway they were consistent, though … that’s odd. Is there a way for me to get a similar profile dump for a non-hitched frame so I’ve got something to compare against?

Re: Lag vs. Freeze: The player input seems non-responsive and is then processed all-of-a-sudden once the hitch is done. Like, you’ll be suddenly spun 180 degrees once a few frames get through. It plays like a game with the settings cranked on a system that can’t handle it.

Re: Shaking: My 3D reticle appears to be hopping on screen, as if my camera is jumping towards it, then pulling back 2-5 times a second. Relevant? Maybe.

Found It!

McAfee AntiVirus Plus: Real-Time Scanning (Build 18.0.9019) is what was causing writing to file to be sluggish in 4.12. Disabling Real-Time Scanning completely removed my hitches/slowdowns.

I have no idea what might have changed in that regard since 4.11, and I haven’t found any logs from McAfee to indicate what about replays in 4.12 it doesn’t like, but it’s clearly something.

,

Anti-viruses in general have been known to cause trouble for the editor. I’m glad that you were able to resolve this issue on your own.