Hot-reload "Compiling Game Code" hang

My development style is to code in Visual Studio, build in Visual Studio, and then watch happily as UE4 editor hot-reloads the changes.

As part of the hot-reload process, there is a pause where a dialogue comes up “Compiling Game Code” and it usually pauses on 19%. This pause used to last 10-20 seconds. My impression is, that this is where the blueprints and instances are updated based on the freshly loaded library.

The problem is that when I upgraded from 4.10.4 to 4.11.2, this 10-20 second compile time rose horribly to 300-400 seconds. Through roll-backs I am certain that this was the event, and comparing the file changes (there are only four) I can’t see any obvious cause.

Does anybody have any suggestion as to how I can investigate and/or rectify this? 5 minute wait times are building up fast.

Some additional information, this is what results from a Hot Reload in the Output Log:

CompilerResultsLog: New page: Compilation - 6 Jun 2016 17:41:44
CompilerResultsLog: Info Compiling game modules for hot reload
CompilerResultsLog: Info Performing 3 actions (2 in parallel)
CompilerResultsLog: Info [1/3] Link UE4Editor-EotULoadingScreen-808.dll
CompilerResultsLog: Info Resource.cpp
CompilerResultsLog: Info Creating library C:\Users\Matt\Documents\Perforce\EotUWorkspace\EotU\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-EotULoadingScreen-808.lib and object C:\Users\Matt\Documents\Perforce\EotUWorkspace\EotU\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-EotULoadingScreen-808.exp
CompilerResultsLog: Info [3/3] Link UE4Editor-EotU-3502.dll
CompilerResultsLog: Info Creating library C:\Users\Matt\Documents\Perforce\EotUWorkspace\EotU\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-EotU-3502.lib and object C:\Users\Matt\Documents\Perforce\EotUWorkspace\EotU\Intermediate\Build\Win64\UE4Editor\Development\UE4Editor-EotU-3502.exp
CompilerResultsLog: Info Total build time: 13.78 seconds
LogMainFrame: MainFrame: Module compiling took 13.989 seconds
LogClass: EJobStatus HotReload.
LogClass: ETileFunction HotReload.
LogClass: EPlayerTool HotReload.
LogClass: EAnimationType HotReload.
LogClass: ECreatureStatus HotReload.
LogClass: EStrategyTeam HotReload.
LogClass: AllocatedAnt HotReload.
LogClass: PlayerData HotReload.
LogHotReload: Re-instancing UGTile after hot-reload.
LogHotReload: Re-instancing JobManager after hot-reload.
LogContentBrowser: Native class hierarchy updated for ‘EotU’ in 0.0116 seconds. Added 40 classes and 5 folders.
Module being reloaded does not support dynamic unloading – abandoning existing loaded module so that we can load the recompiled version!
Warning: HotReload successful (106 functions remapped 2 scriptstructs remapped)
LogContentBrowser: Native class hierarchy populated in 0.0282 seconds. Added 2089 classes and 378 folders.
Warning: HotReload took 329.9s.

  1. Line 22 - is this a sign of any trouble?
  2. Why are only two classes re-instanced, and why those two classes?? It does seem that the number of UGTile instances in the level correlates with the length of time taken.

I found that the problem alleviated entirely when I removed a call to

FMath::RandRange(0, 100);

from the constructor of my UGTile class. Must be some kind of change in 4.11.0 onwards that causes this to function a lot slower in the circumstance under which it was being run.