My time on WSL: real 0m0.014s user 0m0.014s sys 0m0.001s The cost most likely come from the creation of new shell process even you empty the shell script I think there isn't much difference. Could you try the method I said before? Immediate make variable could avoid invoke the shell script at every reference location which is some form of cache inside make instead of incdir.sh.
> -----Original Message----- > From: Gregory Nutt <spudan...@gmail.com> > Sent: Friday, May 29, 2020 10:11 PM > To: dev@nuttx.apache.org > Subject: Re: MSYS2 build slow > > > > Would please someone do the following command on Linux and Cygwin? > > > > time tools/incdir.sh -s arm-none-eabi-gcc > > /home/Schock/nuttx/nuttx/include > > > > (Replace the path with your NuttX path.) > > > > For MSYS2 it's in the range of: > > > > real 0m0,189s > > user 0m0,061s > > sys 0m0,045s > > > I don't have the Linux box on now, but here are the results on Cygwin (32Gb > Rizen 5 3600, NVMe): > > First time: > > $ time tools/incdir.sh -s arm-none-eabi-gcc > /home/Schock/nuttx/nuttx/include > -isystem "/home/Schock/nuttx/nuttx/include" > > real 0m0.198s > user 0m0.000s > sys 0m0.092s > > Thereafter: > > real 0m0.094s > user 0m0.000s > sys 0m0.075s > > After incdir.sh has been included in the in-memory cache, it is pretty fast. > But it can never be super fast. Both Cygwin and MSYS2 > suffer from the well documented fork problem: > https://superuser.com/questions/133313/can-i-speed-up-cygwins-fork . So that > is what causes the ports of GNU tools to be so slow > in Cygwin. Anti-virus run time checking is a big factor too. >