Speed/latency issues for development in a Wine environment

Jeff Zaroyko jeffzaroyko at gmail.com
Fri Jun 18 21:55:00 CDT 2010


On Sat, Jun 19, 2010 at 11:00 AM, David Gerard <dgerard at gmail.com> wrote:
> On 18 June 2010 20:12, Alan W. Irwin <irwin at beluga.phys.uvic.ca> wrote:
>
>> That would be a most interesting comparison.  In computer terms 150 ms is an
>> absolutely enormous time that allows something like 150 million (!)
>> operations to occur on modern PC's.  So I would be surprised if Microsoft
>> Windows required that long to start up applications.
>
>
> Creating processes on Windows is *expensive*. Do a
> "./configure;make;make install" natively in Cygwin for any piece of
> open source software and you'll be amazed how slow ./configure is to
> run. This is because ./configure works by making a source code file,
> compiling it in gcc and then running the resultant binary; this is
> easy on a Unix, very laborious on Windows.
>
> So I don't know, but I would be unsurprised if it's Wine doing all the
> stuff it has to do to pretend to be Windows.
>
> Cygwin runs under Wine. How does ./configure for a given program
> running on Cygwin on Wine compare to ./configure for the same program
> running on Cygwin on Windows on the same hardware?
>
>
> - d.

Since mingw isn't a cygwin application, what relevance does cygwin's
sh and configure have here?  It's a much more complicated beast.  I
think you would be right to say that creating processes in the cygwin
environment is expensive, but otherwise if we should restrict the
obersvation to mingw's gcc since that's what was mentioned:

Windows:
$ time gcc --version
gcc.exe (GCC) 3.4.5 (mingw-vista special r3)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

real    0m0.020s
user    0m0.000s
sys     0m0.015s

Wine:
jeffz at genera:~$ WINEPREFIX=/home/jeffz/wine-cpbench time
~/git/wine/wine "c:\mingw\bin\gcc" "--version"
gcc.exe (GCC) 3.4.5 (mingw-vista special r3)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

0.00user 0.01system 0:00.02elapsed 66%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+1567minor)pagefaults 0swaps


If we look at serial process creation with 1000 invocations of gcc --version

#include <windows.h>
#include <stdio.h>
int main(void)
{
 STARTUPINFO si;
 PROCESS_INFORMATION pi;
 char* proc = "c:\\mingw\\bin\\gcc.exe --version";
 int i;
 ZeroMemory(&si, sizeof(si));
 si.cb = sizeof(si);
 ZeroMemory(&pi, sizeof(pi));
 for(i = 0; i < 1000;i++)
 {
   if(!CreateProcessA(NULL, proc, NULL,NULL, FALSE,0,NULL,NULL,&si,&pi))
     { puts("fail\n"); }
   WaitForSingleObject(pi.hProcess, INFINITE);
   CloseHandle(pi.hProcess);
   CloseHandle(pi.hThread);
 }
 return 0;
}

This takes 3.2 seconds on Windows Vista SP2 with output directed to
nul, Intel Core 2 2.6GHz.
8 seconds under Wine (with wineserver already running) 1.2-rc3 with
output directed to /dev/null.  Intel Core 2 2.4GHz.

If we test actual compiling, so gcc does some IO.  Both mingw gcc
3.4.5, 50 iterations of compiling the following:

#include <windows.h>
#include <stdio.h>
int main(void)
{
 STARTUPINFO si;
 PROCESS_INFORMATION pi;
 char* proc = "c:\\mingw\\bin\\gcc.exe cp2.c -o cp2.exe";
 int i;
 ZeroMemory(&si, sizeof(si));
 si.cb = sizeof(si);
 ZeroMemory(&pi, sizeof(pi));
 for(i = 0; i < 100;i++)
 {
   if(!CreateProcessA(NULL, proc, NULL,NULL, FALSE,0,NULL,NULL,&si,&pi))
     { puts("fail\n"); }
   WaitForSingleObject(pi.hProcess, INFINITE);
   CloseHandle(pi.hProcess);
   CloseHandle(pi.hThread);
 }
 return 0;
}

Windows: $ gcc cp2.c -o cp2bench.exe && time cp2bench.exe

real    0m22.453s
user    0m0.000s
sys     0m0.000s

Wine:

jeffz at genera:~$ WINEPREFIX=/home/jeffz/wine-cpbench time
~/git/wine/wine cmd "/c cp2bench.exe"
0.10user 0.02system 0:26.53elapsed 0%CPU (0avgtext+0avgdata 0maxresident)k


I don't use cmake, so I'm not sure how that behaves, but otherwise
mingw-gcc doesn't seem to have enough of a performance difference that
would bother me.

Jeff



More information about the wine-devel mailing list