The compilation is very slowly

Brattchess
Posts: 7
Joined: Mon Jul 16, 2018 6:04 am

The compilation is very slowly

Postby Brattchess » Wed Sep 05, 2018 4:31 pm

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?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: The compilation is very slowly

Postby ESP_Angus » Thu Sep 06, 2018 2:29 am

How are you building ESP-IDF now? By running "make", or by using Eclipse or some other program?

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: The compilation is very slowly

Postby kolban » Thu Sep 06, 2018 3:29 am

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.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

Brattchess
Posts: 7
Joined: Mon Jul 16, 2018 6:04 am

Re: The compilation is very slowly

Postby Brattchess » Thu Sep 06, 2018 6:27 am

Hello,

I am using eclipse framework.

Best regards,
Juan

francescofcf
Posts: 10
Joined: Wed Sep 05, 2018 8:02 am

Re: The compilation is very slowly

Postby francescofcf » Thu Sep 06, 2018 6:47 am

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: The compilation is very slowly

Postby ESP_Angus » Thu Sep 06, 2018 7:21 am

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 20996 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.

francescofcf
Posts: 10
Joined: Wed Sep 05, 2018 8:02 am

Re: The compilation is very slowly

Postby francescofcf » Thu Sep 06, 2018 8:27 am

thanks it works very well

User avatar
fly135
Posts: 606
Joined: Wed Jan 03, 2018 8:33 pm
Location: Orlando, FL

Re: The compilation is very slowly

Postby fly135 » Thu Sep 06, 2018 3:16 pm

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

Brattchess
Posts: 7
Joined: Mon Jul 16, 2018 6:04 am

Re: The compilation is very slowly

Postby Brattchess » Mon Sep 10, 2018 6:20 am

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

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: The compilation is very slowly

Postby ESP_Angus » Mon Sep 10, 2018 6:36 am

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?

Who is online

Users browsing this forum: Majestic-12 [Bot] and 397 guests