Extremely slow Hot Reload, even with IWYU?

Hello, I’ve just spent the last 3 hours converting my entire project to use IWYU, as I heard it was supposed to speed up compile/hot reload times.
(PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs)

However on my SSD, hot reloading takes 10-15+ minutes with even the smallest change (even just changing a single number!)

Now after changing to IWYU it seems like even regular compiling is taking longer. Editing any single file makes VS compile every class in the entire project every time.

Am I doing something wrong or what’s going on here with these hot-reloads and longer compiles?

My iteration times are pretty quick (few seconds), and I simply:

  • Run my game through Visual Studio, always. If I have to make a change, I just stop running, recompile, and relaunch. Hot Reload is too unreliable. Iterative compile times should be pretty quick (again, a few seconds if you just modified a simple source file).
  • Use forward declaration as much as possibly to avoid files being compiled when they don’t really need to “know” about the class.

If the class you changed is the base class for a bunch of other classes, that could cause a big compile chain - but that’s about it.

Thanks for the info.

Found out running the game in this method (shortcut with the -game command) will actually use the compiled code for very quick iteration. Nice! Wish I knew about that when I started the game back in 4.8 lol.

However launching from VS sounds cool too. If you use a different method than what I listed please share! :slight_smile:

Sure.

  1. Install UnrealVS extension: UnrealVS Extension | Unreal Engine Documentation
  2. Open up your MyProject.sln (or whatever your game is called).
  3. Put your Project path in the Unreal Extension Toolbar (i.e. “C:/MyProject/MyProject.uproject”)
  4. Run/debug like normal.

Thanks, but this seems to just run the last cooked build. Which, even if it used current code, that means it would be using all the old blueprints. Unless I’ve got something wrong?

Development - Win64 — Projectname - “D:\Projectname.uproject” -skipcompile

Blueprints should be re-compiled on launch by default. Remove “-skipcompile” and see what you get.