Page 1 of 1

The compilation is very slowly

Posted: Wed Sep 05, 2018 4:31 pm
by Brattchess
Hello,

I would like to improve the time of the compilation.
It is very slowly and it makes imposible to work with ESP32.

I am reading some threads about it and I think that it could be very good issue:
Run the build with "make -jN" where N is a large-ish number (try double the number of CPUs in your system).

but where I must to put this line?

Re: The compilation is very slowly

Posted: Thu Sep 06, 2018 2:29 am
by ESP_Angus
How are you building ESP-IDF now? By running "make", or by using Eclipse or some other program?

Re: The compilation is very slowly

Posted: Thu Sep 06, 2018 3:29 am
by kolban
Has anyone done a performance test of a build on Linux compared to a build on Windows 10 for the same application/project? If not, I'll be happy to run Windows 10 and Linux in two Virtual Box environments on Windows 10 with both configured to the same RAM and same processor count. Everything I have seen so far leads me to a "visual feel" that Linux is dramatically faster but I haven't quantified that yet. I'm posting here in case someone has some existing metrics or may have done the experiment themselves.

Re: The compilation is very slowly

Posted: Thu Sep 06, 2018 6:27 am
by Brattchess
Hello,

I am using eclipse framework.

Best regards,
Juan

Re: The compilation is very slowly

Posted: Thu Sep 06, 2018 6:47 am
by francescofcf
I also had the same problem, I solved in part this way:

1. Regedit
2. Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender
3. create key DisableAntiSpyware -> value 1

Re: The compilation is very slowly

Posted: Thu Sep 06, 2018 7:21 am
by ESP_Angus
You can enable parallel builds (equivalent of -j option) in the Project Properties under C/C++ Build -> Behavior:
eclipse_build.png
eclipse_build.png (103.18 KiB) Viewed 20009 times
Will add this to the Eclipse Setup guide.

You may find you get even better performance on Windows by choosing more than the "Optimal" number of jobs.
Has anyone done a performance test of a build on Linux compared to a build on Windows 10 for the same application/project?
Currently Linux is significantly faster, to the extent that running Linux in a VM on a Windows host is significantly faster than building on the host.

Running parallel builds helps in Windows. However the slowness of Windows builds was a major reason for supporting CMake in IDF V3.2 (and migrating to CMake by default in IDF v4.0.) Building under CMake is still faster in Linux, but the difference is significantly less...

(When we were first previewing CMake, a full CMake+ninja build under Windows was approximately as fast as a GNU Make build under Linux, but a full CMake+ninja build under Linux was faster than a GNU Make build under Linux... I haven't re-benchmarked since the CMake support became more mature.)
1. Regedit
2. Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender
3. create key DisableAntiSpyware -> value 1
Disabling Windows Defender entirely is an option if you don't mind disabling all spyware protection... A number of people have reported success by adding their MSYS32 directory (and any directory containing IDF files) to an "ignore" list for Windows Defender and/or other anti-virus programs.

If doing this, remember not to download any untrusted content into these directories.

Re: The compilation is very slowly

Posted: Thu Sep 06, 2018 8:27 am
by francescofcf
thanks it works very well

Re: The compilation is very slowly

Posted: Thu Sep 06, 2018 3:16 pm
by fly135
I have Win 10 Defender set to ignore my development directory. Because a build creates so many files it gets Defender really chugging if you don't. I've been developing for the last 8 months in windows using the -j8 (8 = number of threads in CPU, or 2 x # of cores), and I haven't found it to be so slow as to be a problem. I normally develop with a Win 7 computer, but my newest laptop has 10 and I use it for work occasionally.

John A

Re: The compilation is very slowly

Posted: Mon Sep 10, 2018 6:20 am
by Brattchess
francescofcf wrote:thanks it works very well
Hello,

When I modify this parameter I had an error.
IS it possible that you must indicate to the compiler the order of the files to do the compilation?

Best regards,
Juan

Re: The compilation is very slowly

Posted: Mon Sep 10, 2018 6:36 am
by ESP_Angus
Brattchess wrote:
francescofcf wrote: When I modify this parameter I had an error.
IS it possible that you must indicate to the compiler the order of the files to do the compilation?
No, the build system should support parallel builds already. What error did you get?