Hi,
I am trying to figure out why the startup performance of msys executables is so
poor.  Usually this is blamed on Windows itself, however, if you compare startup
time of cmd.exe to that of msys's sh.exe, the first is almost 15 times faster
than the second (15ms vs 250ms on my machine), so there's got to more to that.

Examining sh.exe's startup with the Process Monitor shows that it loads a whole
zoo of Windows DLL, which add up to quite a lot (see table at the end).
I am questioning everything after user32.dll.  These do not even appear in the
import table!   Process Monitor shows that these are dynamically loaded by
something in msys-1.0.dll.

Any ideas, what's going on there?

Vadim


00:00:05.6336634    sh.exe    4024    Load Image    C:\MinGW\msys\1.0\bin\sh.exe    SUCCESS    Image Base: 0x400000, Image Size: 0x92000
00:00:05.6337507    sh.exe    4024    Load Image    C:\Windows\System32\ntdll.dll    SUCCESS    Image Base: 0x7fa97ff0000, Image Size: 0x1c0000
00:00:05.6338345    sh.exe    4024    Load Image    C:\Windows\SysWOW64\ntdll.dll    SUCCESS    Image Base: 0x772d0000, Image Size: 0x157000
00:00:05.6343093    sh.exe    4024    Load Image    C:\Windows\System32\wow64.dll    SUCCESS    Image Base: 0x77280000, Image Size: 0x45000
00:00:05.6344594    sh.exe    4024    Load Image    C:\Windows\System32\wow64win.dll    SUCCESS    Image Base: 0x77220000, Image Size: 0x5a000
00:00:05.6345407    sh.exe    4024    Load Image    C:\Windows\System32\wow64cpu.dll    SUCCESS    Image Base: 0x77210000, Image Size: 0x8000
00:00:05.6348782    sh.exe    4024    Load Image    C:\Windows\System32\kernel32.dll    SUCCESS    Image Base: 0x4a0000, Image Size: 0x136000
00:00:05.6349830    sh.exe    4024    Load Image    C:\Windows\SysWOW64\kernel32.dll    SUCCESS    Image Base: 0x767f0000, Image Size: 0x130000
00:00:05.6350707    sh.exe    4024    Load Image    C:\Windows\System32\kernel32.dll    SUCCESS    Image Base: 0x4a0000, Image Size: 0x136000
00:00:05.6351434    sh.exe    4024    Load Image    C:\Windows\System32\user32.dll    SUCCESS    Image Base: 0x4a0000, Image Size: 0x14c000
00:00:05.6355634    sh.exe    4024    Load Image    C:\Windows\SysWOW64\kernel32.dll    SUCCESS    Image Base: 0x767f0000, Image Size: 0x130000
00:00:05.6356845    sh.exe    4024    Load Image    C:\Windows\SysWOW64\KernelBase.dll    SUCCESS    Image Base: 0x74c40000, Image Size: 0xa6000
00:00:05.6370900    sh.exe    4024    Load Image    C:\MinGW\msys\1.0\bin\msys-1.0.dll    SUCCESS    Image Base: 0x60800000, Image Size: 0x105000
00:00:05.6372654    sh.exe    4024    Load Image    C:\MinGW\msys\1.0\bin\msys-regex-1.dll    SUCCESS    Image Base: 0x6af40000, Image Size: 0x17000
00:00:05.6374318    sh.exe    4024    Load Image    C:\MinGW\msys\1.0\bin\msys-termcap-0.dll    SUCCESS    Image Base: 0x6a2c0000, Image Size: 0x12000
00:00:05.6375524    sh.exe    4024    Load Image    C:\Windows\SysWOW64\user32.dll    SUCCESS    Image Base: 0x76490000, Image Size: 0x116000
00:00:05.6379258    sh.exe    4024    Load Image    C:\Windows\SysWOW64\gdi32.dll    SUCCESS    Image Base: 0x76ef0000, Image Size: 0xfd000
00:00:05.6388891    sh.exe    4024    Load Image    C:\Windows\SysWOW64\imm32.dll    SUCCESS    Image Base: 0x76470000, Image Size: 0x20000
00:00:05.6390251    sh.exe    4024    Load Image    C:\Windows\SysWOW64\msctf.dll    SUCCESS    Image Base: 0x74f40000, Image Size: 0xde000
00:00:05.6391295    sh.exe    4024    Load Image    C:\Windows\SysWOW64\msvcrt.dll    SUCCESS    Image Base: 0x76e30000, Image Size: 0xb1000
00:00:05.6403536    sh.exe    4024    Load Image    C:\Windows\SysWOW64\advapi32.dll    SUCCESS    Image Base: 0x77160000, Image Size: 0xae000
00:00:05.6406180    sh.exe    4024    Load Image    C:\Windows\SysWOW64\sechost.dll    SUCCESS    Image Base: 0x76430000, Image Size: 0x34000
00:00:05.6407587    sh.exe    4024    Load Image    C:\Windows\SysWOW64\rpcrt4.dll    SUCCESS    Image Base: 0x74b60000, Image Size: 0xac000
00:00:05.6409593    sh.exe    4024    Load Image    C:\Windows\SysWOW64\sspicli.dll    SUCCESS    Image Base: 0x74910000, Image Size: 0x1c000
00:00:05.6412335    sh.exe    4024    Load Image    C:\Windows\SysWOW64\cryptbase.dll    SUCCESS    Image Base: 0x74900000, Image Size: 0x9000
00:00:05.6414593    sh.exe    4024    Load Image    C:\Windows\SysWOW64\bcryptprimitives.dll    SUCCESS    Image Base: 0x748a0000, Image Size: 0x51000
00:00:05.6437772    sh.exe    4024    Load Image    C:\Windows\SysWOW64\netapi32.dll    SUCCESS    Image Base: 0x5fb50000, Image Size: 0x12000
00:00:05.6439945    sh.exe    4024    Load Image    C:\Windows\SysWOW64\netutils.dll    SUCCESS    Image Base: 0x5fb40000, Image Size: 0xb000
00:00:05.6441853    sh.exe    4024    Load Image    C:\Windows\SysWOW64\srvcli.dll    SUCCESS    Image Base: 0x5fb20000, Image Size: 0x1c000
00:00:05.6443727    sh.exe    4024    Load Image    C:\Windows\SysWOW64\wkscli.dll    SUCCESS    Image Base: 0x5fb10000, Image Size: 0x10000
00:00:05.6449411    sh.exe    4024    Load Image    C:\Windows\SysWOW64\samcli.dll    SUCCESS    Image Base: 0x5faf0000, Image Size: 0x12000
00:00:05.6452217    sh.exe    4024    Load Image    C:\Windows\SysWOW64\samlib.dll    SUCCESS    Image Base: 0x60ac0000, Image Size: 0x14000