-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[config] Do not read MK_ARCH & MK_CPU if already defined #1760
Conversation
1b149a4
to
a3526d1
Compare
a3526d1
to
5e5339d
Compare
Wow @and3rson, nice catch!! The code you found running a shell and grep for every Makefile is quite ancient, I wasn't even aware of it. In addition, the CONFIG_CPU_xxx defines and ifdefs have been completely removed elsewhere, as ELKS is now always built using 8088/8086 instructions only, for wider compatibility (including PC/Jr with only having short conditional jumps using In addition, while CONFIG_ARCH_xxx is used with IBMPC, PC98 and 8018X, the older CONFIG_ARCH_SIBO config which Makefile-rules is using to set MK_ARCH is (or at least I thought it was) completely removed. MK_ARCH is only being used to set the unused ARCH_LD setting for the SIBO port, which was removed some time ago.
Nice idea - I'll have to try this myself to see what short of other shenanigans might be occurring :)
That's fantastic. There have been some other reports by users, unreproducible on my machines, that the ELKS make mechanism was running very slowly (IIRC during 'make clean' but nonetheless with excessive shell spawns). I am wondering why the
Please point them out, I'd love to get them fixed. Given the current uses of MK_ARCH and MK_CPU, I'll commit your fix now, then delete the shell/grepping entirely in a follow-on commit, as described above its really not needed. Thank you! |
I think it might be just because it's called a lot; I haven't gotten the fastest machine (i5-10210U), but it isn't too slow either. :)
make SHELL='sh -c' 2>&1 | tee log
sort log | uniq -c | sort -hr | less Here are the most frequently executed commands, each prepended with number of occurences:
(Some of them, such as |
This is great! I'm already finding tons of useless stuff going on... improvements coming :)
You may want to try |
While investigating why my local bulds were taking so long, I noticed that
grep
is being called a lot. I figured that by runningmake SHELL='sh -x'
.This fix significantly improves rebuild times by not setting
MK_ARCH
&MK_CPU
if they are already set somewhere up the Makefile chain.On my machine, when running
make all
with some minor changes to the code (or no changes at all), this fix reduces build time from over 10 minutes to ~48s.Similar change might be applied to some other places - I've seen some other heavy find/grep calls in the Makefile.