dotBunny / CLionSourceCodeAccess

A CLion Plugin for Unreal Engine
136 stars 26 forks source link

Launch external terminal for compilation. #104

Open Zerophase opened 5 years ago

Zerophase commented 5 years ago

I was just thinking of benchmarking engine compilation in alacritty, as printing to the terminal tends to be a bottleneck. (Alacrittty uses the systems gpu for terminal output) This option might actually fix the slight delay when compiling Unreal in CLion on Linux too. Launching the compilation process through a standardized range of systems would help benchmark, as my gpu is not exactly the best for figuring out if this improves compile times for a range of modern systems. It would be nice if launching an external terminal was a feature in the CLion source accessor as well for supporting endevours such as this.

S-Marais commented 5 years ago

Depending of the UE version you are compiling, be aware that UE now uses a shipped llvm and uses UBT to compile UE and project on any platform.

Zerophase commented 5 years ago

Oh sure, it does use the shipped llvm by default, and UBT for compiling on any platform. I'm saying the terminal the UE build process starts in impacts the build speed. For instance, the CLion default terminal has a slight delay of a couple seconds when the build process first starts. Tilda and Guake on the other hand start building right away when the same command is run.

Now, printing to the terminal is a significant bottleneck for the build process. (If there was a UBT option, compatible with Linux, for turning off all printing to the terminal you could see close to 10 minutes saved in the build process) A similar concept is me cutting ten seconds off of the Linux boot time, by disabling all error printing at boot, unless something critical breaks. I would like to have Alacritty as an option for this reason because of how it handles printing to the console.

Alacritty might speed up the build process by printing the status update for close to 2,000 item compilation, at once. Let's say 16 logical cores (very doable with an affordable machine these days) are working on compiling files, and traditional terminals printing line by line, rather than batches of glyphs at once introduces a potential bottleneck. I believe Alacritty would significantly improve Unreal compile times through using the later approach for handling characters, and the compilation of close to 2,000 files. Enough files compile at the same time to get a speed up from this. If this holds for using straight make it could be adapted for the CLion build process as well.

I could add this feature in myself, but as I'm focused on other tasks currently. Just posting this here in case someone else decides to add it, or wants to keep it in mind for code design in case I do not get around to this anytime soon.

S-Marais commented 5 years ago

are you talking here about compiling the engine, or the game? I'm asking this because shipped like it is now, the CMake generator within UBT is far from optimized. It adds a lot of extra files and folders that are totally unnecessary. I've PR'd a solution for this that is still awaiting review (since 4.20 :/) that would solve most of these issues (as much as finding clion binary). As for compile, something I'm not sure is said anywhere, while you are developing you should compile the MyGameEditor and not MyGame which should result in a very few files to get compiled when compiling for the first time.

Zerophase commented 5 years ago

In general. There's enough text output where the terminal used matters. I mostly work on the engine, though. Personally, when compilation passes a second I start looking for optimizations, as I'm constantly hitting the compile button while coding.

There are probably issues with Linux.