http://bugs.winehq.org/show_bug.cgi?id=13606
folks, hi,
am running a configure script under wine, and it's _literally_ one to two seconds per sh.exe instance. i started running ./configure over two hours ago and there are about 100 lines of output so far, with a further 200 to go i am better off leaving this running overnight. as this is development work i am doing, not "building something that's already known to work" i have to call a halt to the development, because it is crazy to expect to have to wait four to six hours if i make a single change to configure.in or Makefile.pre.in - god help me if i have to run autoconf (fortunately i can do that from linux).
... so i did some investigation:
strace -o log.txt -ff wine cmd
followed by running c:\msys\msys.bat
ignoring the fact that sh.exe crashed on me (which it doesn't do when you don't use strace) i was able to obtain some system call usage when firing up sh.exe, and it's _horrendous_.
X11 keyboard files, X11 locale files, iconv, windows fonts, unix fonts - all to fire up c:/msys/bin/sh.exe ?
further up the strace files, i'm looking at the biggest offender and it looks like it's reading files one byte at a time. reconstructing some of the sentences i can make out "remember that we get here even under command.com\r\n". ohhh i remember where i've seen that - that's in msys.bat. .... why is it being read one byte at a time?? there are _thousands_ of lines like this:
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 read(13, "t", 1) = 1 rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0 write(3, "7\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64 read(6, "\r\0\0\300\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0 write(3, "4\0\0\0\0\0\0\0\0\0\0\0?\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64 read(6, "$\0\0\300\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHLD IO], [], 8) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
checking earlier in the same strace log file (the one that loaded msys.bat one byte at a time) _again_ i see font-loading (every single one on my system).
there are _forty_ instances of libraries being loaded - per process!
open("/usr/lib/locale/locale-archive", O_RDONLY) = 3 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 3 open("/usr/lib/libwine.so.1", O_RDONLY) = 3 open("/usr/lib/wine/wine-pthread", O_RDONLY) = 3 open("/usr/lib/libwine.so.1", O_RDONLY) = 3 open("/usr/lib/wine/ntdll.dll.so", O_RDONLY) = 3 open("/usr/lib/wine/kernel32.dll.so", O_RDONLY) = 7 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 7 open("/usr/lib/wine/cmd.exe.so", O_RDONLY) = 10 open("/usr/lib/wine/shell32.dll.so", O_RDONLY) = 10 open("/usr/lib/wine/shlwapi.dll.so", O_RDONLY) = 10 open("/usr/lib/wine/user32.dll.so", O_RDONLY) = 10 open("/usr/lib/wine/gdi32.dll.so", O_RDONLY) = 10 open("/usr/lib/wine/advapi32.dll.so", O_RDONLY) = 10 open("/usr/lib/wine/comctl32.dll.so", O_RDONLY) = 10 open("/usr/lib/wine/krnl386.exe16", O_RDONLY|O_LARGEFILE) = 10 open("/usr/lib/wine/system.drv16", O_RDONLY|O_LARGEFILE) = 10 open("/usr/lib/wine/gdi.exe16", O_RDONLY|O_LARGEFILE) = 10 open("/usr/lib32/libfreetype.so.6", O_RDONLY) = 10 open("/usr/lib32/libz.so.1", O_RDONLY) = 10 open("/usr/lib32/libexpat.so.1", O_RDONLY) = 10 open("/usr/lib/wine/user.exe16", O_RDONLY|O_LARGEFILE) = 10 open("/usr/lib/wine/winex11.drv.so", O_RDONLY) = 10 open("/usr/lib32/libSM.so.6", O_RDONLY) = 10 open("/usr/lib32/libICE.so.6", O_RDONLY) = 10 open("/usr/lib32/libXxf86vm.so.1", O_RDONLY) = 10 open("/usr/lib32/libXext.so.6", O_RDONLY) = 10 open("/usr/lib32/libX11.so.6", O_RDONLY) = 10 open("/usr/lib32/libXau.so.6", O_RDONLY) = 10 open("/usr/lib32/libxcb-xlib.so.0", O_RDONLY) = 10 open("/usr/lib32/libxcb.so.1", O_RDONLY) = 10 open("/usr/lib32/libXdmcp.so.6", O_RDONLY) = 10 open("/usr/lib/wine/imm32.dll.so", O_RDONLY) = 10 open("/usr/lib32/libXinerama.so.1", O_RDONLY) = 11 open("/usr/lib32/libXrender.so.1", O_RDONLY) = 11 open("/usr/lib32/libXrandr.so.2", O_RDONLY) = 11 open("/usr/lib32/libXcomposite.so.1", O_RDONLY) = 11 open("/usr/lib32/libXfixes.so.3", O_RDONLY) = 11 open("/usr/lib32/libXcursor.so.1", O_RDONLY) = 11 open("/usr/lib/wine/uxtheme.dll.so", O_RDONLY) = 11 open("/usr/lib/wine/ole32.dll.so", O_RDONLY) = 11 open("/usr/lib/wine/rpcrt4.dll.so", O_RDONLY) = 11 open("/usr/lib/wine/iphlpapi.dll.so", O_RDONLY) = 11 open("/usr/lib/wine/start.exe.so", O_RDONLY|O_LARGEFILE) = 7
surely, on a console-based command shell, all of the fonts and the X11 libraries can be skipped?
l.