Pentium M and P4 question / and a failed test

Marc Glisse marc.glisse+gmp at
Tue Oct 2 19:31:37 CEST 2007

(this is getting quite off topic)

On Tue, 2 Oct 2007, Patrick Pelissier wrote:

>> The shells used by Cygwin as well as MinGW just are terribly slow compared
>> to the ones under Linux/MacOSX. I have some python code that uses execlp()
>> + startup of child processes (via pexpect) that takes 2-5 times as long
>> compared to doing it under Linux on the same hardware. I am sure that the
>> Cygwin and MinGW developers are aware of the problem, but my guess is that
>> it isn't obvious to fix and probably due to the need to emulate POSIX
>> functionality on top of the Windows kernel in userspace.
> There is no fork command on Windows.
>  cygwin/mingw has to use CreateProcess + a copy instead for emulating
> the fork command.
> In consequence, the scripts are slower on Windows.
> There is no way to solve this problem I think.

There is one solution: don't use fork when you don't need to. vfork, and 
better posix_spawn can be implemented way more efficiently (I haven't 
checked what cygwin actually does).

For shell scripts, you might want to try ksh93, one of the few shells that 
do not make an excessive use of fork (besides, like bash, it has many 
builtins that do not require a new process at all).

Marc Glisse

More information about the gmp-discuss mailing list