I updated my project from version 4.27.2 to 5.0.0 and C++ compilation is taking about twice as long, sometimes longer. This occurs for both compilation from Visual Studio and for Live Coding.
Looking at the compilation logs, the main difference appears to be that the number of processes is lower in UE5. Refer to the below logs:
Visual Studio Community 2019 16.11.12, toolchain 14.29.30142
Windows 10.0.19041.0 SDK
Intel(R) Core™ i7-6700 CPU @ 3.40GHz (Cores: 4, Logical processors: 8)
Test case: Adding and removing a whitespace from a relatively small cpp file in my project and compiling.
Note: This is a project-only build configuration, so there is no Engine compilation involved.
Live Coding, UE4:
Building 1 action with 8 processes...
(Module.proj.cpp)
Total time in Parallel executor: 43.87 seconds
Total execution time: 44.67 seconds
Live Coding, UE5:
Determining max actions to execute in parallel (4 physical cores, 8 logical cores)
Executing up to 4 processes, one per physical core
Building 1 action with 1 process...
(Module.proj.cpp)
Total time in Parallel executor: 92.17 seconds
Total execution time: 97.24 seconds
Visual Studio, UE4:
1>Building 4 actions with 8 processes...
(module.proj.cpp, UE4Editor-proj.lib, UE4Editor-proj.dll, ProjEditor.target)
1>Total time in Parallel executor: 45.47 seconds
1>Total execution time: 46.32 seconds
Visual Studio, UE5:
1>Determining max actions to execute in parallel (4 physical cores, 8 logical cores)
1> Executing up to 4 processes, one per physical core
1>Building 4 actions with 4 processes...
(module.proj.cpp, UE4Editor-proj.lib, UE4Editor-proj.dll, ProjEditor.target)
1>Total time in Parallel executor: 86.94 seconds
1>Total execution time: 87.70 seconds
As you can see, in addition to taking about twice as long, 8 processes are in use when compiling in UE4, whereas either 1 or 4 processes are in use when compiling in UE5, for Live Coding and Visual Studio respectively.
Is this issue occurring for anyone else, and does there happen to be a workaround or is there a fix in the works? This is a pretty significant hit on productivity, especially with my 6-year-old CPU. Thanks.
Edit: I also tried creating the following BuildConfiguration.xml (reference page) to see if this would resolve the issue. However, as you can see in the below logs, the number of processes did not increase and the compile time didn’t change (confirmed no time difference before and after).
<?xml version="1.0" encoding="utf-8" ?>
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<ParallelExecutor>
<MaxProcessorCount>64</MaxProcessorCount>
<ProcessorCountMultiplier>4.0</ProcessorCountMultiplier>
</ParallelExecutor>
</Configuration>
UE5 Visual Studio build after adding the above xml:
1>Determining max actions to execute in parallel (4 physical cores, 8 logical cores)
1> Requested 4 process count multiplier: limiting max parallel actions to 16
1> Requested 1.5 GB free memory per action, 20.13 GB available: limiting max parallel actions to 13
1>Building 4 actions with 4 processes...
(...)
1>Total time in Parallel executor: 77.79 seconds
1>Total execution time: 79.53 seconds
Also, if I turn all the ParallelExecutor logs on in BuildConfiguration.xml, the following is evident in regards to the project module compilation. Not sure if “Wall Time” indicates anything meaningful:
1>Compile Module.proj.cpp [ Wall Time 79.54 s / CPU Time 93.14 s ]
(the other 3 actions each take 0-2 seconds each)
(note: also no change or improvement when setting Configuration::BuildConfiguration::MaxParallelActions to a high number like 12 or 24 in BuildConfiguration.xml)
Edit: Issue confirmed to still occur as originally reported on latest version, UE5.0.1 UE5.0.2 UE5.0.3