make: enable SECONDEXPANSION for module/application builds#12708
make: enable SECONDEXPANSION for module/application builds#12708aabadie merged 1 commit intoRIOT-OS:masterfrom
Conversation
|
I tried to find a performance difference. I've used gnrc_networking as it has a high number of recursive make calls. I'm using hyperfine for measurements, set to five warmup runs ( This is with secondexpansion disabled: This is with secondexpansion enabled: TL;DR: no performance difference with current make version. |
|
To confirm your results I used the With Without In both cases I did not use |
|
(done on an Ubuntu 19.10) |
@miri64 Are those results repeatable? Using your for loop (with fixed "do;"), I still get the same results with/without SECONDEXPANSION. |
|
GNU Make 4.2.1. I'm trying to repeat the tests on a machine that isn't used during the test (an Arch Linux in this case however but also with make 4.2.1). |
|
(the Ubuntu machine is my main work machine and a lot of other things happened during the tests) |
|
Here are the results, I ran the experiment two times for every configuration this time, just to make sure I don't include any FS caching effects (so the reports below are from the second run): With without: The tests this time were run with 8 threads on an Intel i7-8550U (4 physical cores, 8 hyper threads), and not much else was running on the machine (nearly all services killed by hand before running the tests): Find the detailed process on my nextcloud (link is valid until the end of this year). |
|
Thanks @miri64 for repeating the benchmarks! |
|
My Ubuntu isn't that much different from Arch when it comes to compiling, I noticed (make versions are the same, GCC is just one version behind [native GCC even one point release ahead!]) are the same. That's why I didn't repeat them on the Ubuntu machine with the same process. |
|
@miri64 so what is your conclusion here, based on your tests? Is there some impact? Or not, as claimed by @kaspar030 ? |
|
There seems to be a (very small) speed trade-off that is negligible IMHO. BTW I figured out that for my Ubuntu tests I apparently had ccache activated without my knowledge after all. That explains the insane speeds I got there. |
Do you have an idea why ccache is introducing such a difference ? If ccache has an impact, I guess performance on Murdock could decrease, since it uses ccache to speed-up the builds. |
|
Why only enabling this feature for modules/application and not also for all other targets prerequisites (from Makefile.include) ? |
|
I don't think ccache has a high impact... I think because ccache was activated, the execution was much quicker, so anything that happened unrelated to compilation during compilation was factored in much higher into the run-times. |
I wanted to say with that: Please ignore my measurements from #12708 (comment). They may not be reliable ;-). |
Honestly, because I need it only for modules/apps. The flag would have to be set in bot Makefile.include and Makefile.base, as the former calls the latter recursively. I suggest adding it to Makefile.include as soon as there's a user at least in sight? |
aabadie
left a comment
There was a problem hiding this comment.
Thanks @miri64 for the bench results. So apparently there's no impact on performance and this feature will be useful in #11870.
As suggested by @kaspar030, we can discuss later if it also be used in Makefile.include.
ACK and go.
Contribution description
This PR enables GNU make SECONDEXPANSION for all module/application builds.
See the GNU make for more information.
This will make support for module source files in subfolders easy to implement.
See e.g., #11870.
This has been split out of #11870 in order to isolate any possible side effects.
Testing procedure
All build outputs should be binary identical.
Issues/PRs references
Split out of #11870.