Page 1 of 2

ESP32 compiling time is way too long!

Posted: Tue May 14, 2019 8:27 pm
by bonmotwang
Hello other developers.
ESP32 takes minutes to compile. How do you guys live with the long compiling time?
Every change takes minutes to verify.

I guess at the later stage in the development it is probably fine.
But at beginning it is really slowing things done!

Thanks

Paul

Re: ESP32 compiling time is way too long!

Posted: Tue May 14, 2019 9:37 pm
by username
The initial build takes a bit. On my system it takes 15 seconds. Once you make a change it will recompile just that file. So it sounds like you possibly got something messed up in your setup install.

Make sure you add the -jx option to make. I.E. make -jx. where x is how many cores your PC has.

Re: ESP32 compiling time is way too long!

Posted: Tue May 14, 2019 9:42 pm
by fly135
I think -jx is x = 2 x cores because each core supports two threads. Also if you are running win10 you should disable defender from scanning your development directory.

John A

Re: ESP32 compiling time is way too long!

Posted: Tue May 14, 2019 10:15 pm
by username
I think -jx is x = 2 x cores because each core supports two threads.
Correct. My current system is a 8 core. so that would be: make -j16. I should have been more clear, just assumed people knew.

Re: ESP32 compiling time is way too long!

Posted: Wed May 15, 2019 1:47 am
by ESP_Angus
Yes, after the initial build only changed source files should be compiled.

The only exception is if you edit the menuconfig. In this case all files need re-compilation with the new config settings.

If you're not seeing this, it may be a bug - please provide some more details so we can help you figure it out.

As others have said, running "make -jN" and (on Windows) disabling Defender or adding Defender exceptions for IDF paths & tools will improve performance a lot.

You can also get better Windows performance by moving to the new CMake build system, but Eclipse support for this is still pending. https://docs.espressif.com/projects/esp ... ted-cmake/

Re: ESP32 compiling time is way too long!

Posted: Wed May 15, 2019 3:09 am
by bonmotwang
I am running it on Windows 7.
This is the build output when I start build:
23:08:25 **** Incremental Build of configuration Default for project blink ****
make -j8 all

Re: ESP32 compiling time is way too long!

Posted: Wed May 15, 2019 3:13 am
by bonmotwang
Output.txt attached.
I didn't change any code. Just compile, it always takes almost a minute to finish.

Re: ESP32 compiling time is way too long!

Posted: Wed May 15, 2019 3:30 am
by bonmotwang
I compiled the project in mingw32 command line.
It only compiles the changes. and much faster.
I attached the output.

So there much be some setting in Eclipse messed up the build?

Thanks

Paul

Re: ESP32 compiling time is way too long!

Posted: Wed May 15, 2019 3:48 am
by ESP_Angus
Hi Paul,

There's more console output in the Eclipse log, but you'll probably get the same console output in MINGW with "make V=1" - verbose output.

48 seconds is a long time, as the Eclipse build log shows that nothing was actually compiled (it just looks at each component and says "nothing needs compiling here").

What ESP-IDF version do you have?

Re: ESP32 compiling time is way too long!

Posted: Wed May 15, 2019 6:43 pm
by bonmotwang
My ESP-IDF version:

Paul@W510 MINGW32 ~/esp/esp-idf
# git describe
v4.0-dev-311-g70eda3d22


Thanks

Paul