How to speed up compilation for C++ scripts?

I’m trying to implement a simple player’s script in C++, in my learning process I’m constantly recompiling my script after each modification, but even through the compilation time is only 20s, it’s still slow for compiling one cpp file of 50 line. Maybe I’m doing something wrong ? Is there something who could speed up compilation time during development ? I just want to compile for my computer, not other platform.

Thank you for your time.

That might be related to your CPU and drive type (SSD vs HDD). In general we have pretty nice performance with our build tool Flax.Build.

To see why it takes so long for you run:
<flax_installation_folder>\Binaries\Tools\Flax.Build.exe -log -logfile=buldLog.txt -build -mutex -buildtargets=GameEditorTarget -skiptargets=FlaxEditor -platform=Windows -arch=x64 -configuration=Development -perf -traceEventFile=traceFile.json -workspace=<projectFolder>

Then in buildLog.txt there will be info about build actions timing and traceFile.json will contain build tool profiling info in Chrome Trace format. Feel free to share those files here so we can debug the problem.

Example trace file contents after opening it in Chrome:


You can find my buildLog and traceFile here :

Total time: 00:00:15.9335713. It seem my build time is a little bit faster without flax and other running in the background. Usually it would range from 17s to 30s.
My laptop is kinda old, I use an HDD, no graphics cards (I should really invest in a proper PC :sweat_smile:, but Flax is still running smoothly the example’s samples.):

Thanks for those files! I see that majority of time was spend on Scripting API parsing with bindings generation but this was already improved for 1.1 update (we cache parsed modules bindings and reflection metadata now) so it will drastically cut build times for you (this PC is really slow but I’m glad that Editor and Flax Samples are running good :smiley: ).

We will ship 1.1 later this week so once it’s out please checkout to see if performance improved (noticeable gain after 2nd compilation I guess).

1 Like

OK, I will wait and notify you at the release then. Thank you.