[Info] Improving build times with parallel makes

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

[Info] Improving build times with parallel makes

Postby kolban » Fri Sep 30, 2016 4:33 am

I am running builds on a Raspberry Pi model 3 which has a quad core / 1GHz per core device. Performance is satisfactory but when I do a full build of everything from scratch, it can take 6 minutes plus. I noted that only 25% of my available CPU capacity was being used which makes sense ... it was basically pegging one CPU. When we run a build using "make" we can specify a "-j <num>" parameter.

See: https://www.gnu.org/software/make/manua ... allel.html

What this does is specify the number of "jobs" to run in parallel. On my Pi, I tested with:

Code: Select all

$ times make -j 5
and found that 100% of my CPU was consumed and the build completed in 50% of the time. I don't know if ESP-IDF is tolerant of parallel compilations but it seems to "sniff" out ok. You might want to try with different numbers of parallel jobs to see where you get the most return.
Last edited by kolban on Fri Sep 30, 2016 3:12 pm, edited 3 times in total.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

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

Re: Improving build times with parallel makes

Postby ESP_Sprite » Fri Sep 30, 2016 6:46 am

While it's not really tested (...reminding me, I should add -j to my own make sessions as well), being able to parallel build esp-idf was a feature we had in mind when we designed it. If you ever do find an error in it, please file a Github issue and we'll try to resolve it.

Who is online

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