Slow Windows builds

dentompie
Posts: 1
Joined: Fri Nov 17, 2017 4:10 pm

Slow Windows builds

Postby dentompie » Fri Nov 17, 2017 4:23 pm

Hi,

I've been struggeling a bit to get a smooth developer experience with the ESP-IDF setup:
1. Building on windows is super slow. It takes about 1 minute to compile hello world in the fastest scenario. Is there a way to speed things up???
2. Everytime I build make project, every single component of the ESP-IDF lib is being built (including IPv6, libsodium) and a lot of other stuff. How can I prevent the compiler from compiling all these things I don't need?

Thanks!

Tom

ESP_Sprite
Posts: 8926
Joined: Thu Nov 26, 2015 4:08 am

Re: Compile issue

Postby ESP_Sprite » Sat Nov 18, 2017 1:26 pm

Building on Windows unfortunately is slower than under other OSses (Mac/Linux). This mostly is because the build system does a fair amount of fork()ing, which is slow under Windows. Normally, this is less of an issue, because after you edit a file and re-run 'make', only the components that are changed get re-built. Can I ask how specifically you re-build your project?

User avatar
Gfast2
Posts: 182
Joined: Fri Aug 11, 2017 1:52 am

Re: Compile issue

Postby Gfast2 » Sat Nov 18, 2017 3:25 pm

Thi Antivirus Software will check if all in compiling time generated file are safe. Which I believe will pull the whole process even slowser!

So I changed to use ESP-IDF in Virtualbox. I am not fan for Virtualization,but it speed up everything. :idea:

cheers

Gfast2

StevieWells
Posts: 3
Joined: Tue Mar 19, 2019 11:21 pm

Re: Compile issue

Postby StevieWells » Wed Apr 03, 2019 12:28 am

Has anyone really got to the bottom of this Windows 10 extremely slow build issue yet?
When I build hello world, it roughly builds at a rate of 1 file every 3s. I would show video, but it's so boring!
Anyway, checking the Task manager shows 0% task usage for the Bash shell, which means it would probably build a lot faster on an ESP32 device, let alone a 3.5GHz Quad Core.
I checked memory usage at 3MB one of the smallest I have seen and no network traffic. So somehow it's mostly asleep! :roll:

make -j4 menuconfig

Takes roughly 30 seconds without building any files (as far as I can see) and with 0% CPU usage.

Any idea what's going on?

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

Re: Compile issue

Postby ESP_Angus » Wed Apr 03, 2019 3:25 am

- Windows Defender real-time scanning can use a lot of CPU checking file accesses during builds. If you look in Windows Task Manager then you may see at least one Service Host process using a lot of CPU. This problem is not unique to IDF, unfortunately. You can add exceptions for ESP-IDF and MSYS2 files/directories and process names in Defender, and this can help a lot. We are working on an automated fix for this, but it's relatively complex and there are obviously risks involved in bypassing Defender checks. (The Microsoft WSL GitHub issue linked above has some more details about the overall issue.)

- The new CMake-based build system with Ninja build tool is quite a bit faster under Windows, as it doesn't require the MSYS2 "unix" layer. It's still subject to Windows Defender scanning, though.

- If it's not these things then I'm not sure what it is: maybe a different anti-virus, or maybe something else?

Who is online

Users browsing this forum: Bing [Bot] and 107 guests