<span>Hi Simon, </span><div><br></div><div>Hmm I'm not sure about replacing sh with bash. I think bash has some Non-POSIX extensions that may affect the behavior of valid posix scripts. </div><div><br></div><div>Is bash --login slow as well? How about once sh or bash starts, are commands still slow then? </div><div><br></div><div>I assume your computer is domain joined and you may be hitting a very long standing issue with certain domain joined machines <a href="https://github.com/Alexpux/MSYS2-packages/issues/138#issuecomment-70813762">https://github.com/Alexpux/MSYS2-packages/issues/138#issuecomment-70813762</a></div><div><br></div><div>The solution seems to be to cache the user info locally instead of it having to query the domain controller everytime. See solution 2 here <br><a href="https://gist.github.com/k-takata/9b8d143f0f3fef5abdab">https://gist.github.com/k-takata/9b8d143f0f3fef5abdab</a> for instructions </div><div><br></div><div>Does that help the problem? </div><div><br></div><div>I believe you had a similar problem last time setting up a new machine. At that time magit was also slow. </div><div><br></div><div>Kind regards, </div><div>Tamar </div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 2, 2018, 23:23 Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com">simonpj@microsoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="#0563C1" vlink="#954F72">
<div class="m_443799751573145407WordSection1">
<p class="MsoNormal">Tamar<u></u><u></u></p>
<p class="MsoNormal">I’ve noticed that “sh” (which is invoked at lot by make etc) takes AGES to start up.  At least I think it’s ‘sh’ that is causing the delay.<u></u><u></u></p>
<p class="MsoNormal">I think it’s c:/msys64/usr/bin/sh.exe<u></u><u></u></p>
<p class="MsoNormal">From searching the web (eg <a href="https://www2.cs.duke.edu/csl/docs/unix_course/intro-60.html" target="_blank">
https://www2.cs.duke.edu/csl/docs/unix_course/intro-60.html</a>)  it seems likely that it executes c:/msys64/etc/profile first.
<u></u><u></u></p>
<p class="MsoNormal">And If I put an ‘echo’ at the start and end of that file, they do seem to take place with a significant gap between them.<u></u><u></u></p>
<p class="MsoNormal">I have not started sprinkling more echos, but does that ring any bells?
<u></u><u></u></p>
<p class="MsoNormal">Can I replace ‘sh’ with c:/msys64/usr/bin/bash.exe, which seems to be faster?   (My evnt variable SHELL already points to bash.exe. )  And if so, how would I do that? An environment variable.  Physically copy bash.exe to sh.exe?  Or what?<u></u><u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p></div></div><div lang="EN-GB" link="#0563C1" vlink="#954F72"><div class="m_443799751573145407WordSection1">
<p class="MsoNormal">Simon<u></u><u></u></p>
</div></div></blockquote></div></div>