Speed up cygwin’s fork

cygwin;speed

I came across a post discussing the speed of forking in Cygwin, giving an expected 'fork rate' in Windows XP of around 30-50 per-second (link)

I've got a Core 2 duo (1.79GHz) which I would expect to get comparable results, but it's only managing around 8 forks per second (and sometimes a lot fewer):

$ while (true); do date --utc; done | uniq -c
      5 Wed Apr 21 12:38:10 UTC 2010
      6 Wed Apr 21 12:38:11 UTC 2010
      1 Wed Apr 21 12:38:12 UTC 2010
      1 Wed Apr 21 12:38:13 UTC 2010
      8 Wed Apr 21 12:38:14 UTC 2010
      8 Wed Apr 21 12:38:15 UTC 2010
      6 Wed Apr 21 12:38:16 UTC 2010
      1 Wed Apr 21 12:38:18 UTC 2010
      9 Wed Apr 21 12:38:19 UTC 2010

Can you suggest anything I might be able to do to speed things up? This machine acts a lot slower in Cygwin than others I've used before which actually were a lot slower.

Update

Let my justify my question: I don't believe that having a faster fork will magically make my life better, but I believe that this benchmark is a good proxy for the performance issues I'm seeing in bash due to normal use of external executables to calculate values. I find I get a noticeable speed up on Cygwin by going through my shell start up scripts and bash-completion and trying to replace external commands with internal ones; on Linux this isn't an issue. Often, though, this isn't possible, and my PC is currently taking ~14s to start a shell with a warm cache and no load.

Best Answer

This has nothing to do with fork being slow.

I've seen cygwin run dog slow when the windows "home" directory was on a network drive. Every single command would search there for binaries slowing things down tremendously.

see if

while (true); do /bin/date --utc; done | uniq -c

is faster, if so, that is probably your problem

otherwise try running bash via strace/ltrace (if they even work on cygwin) and see what it is doing when it takes 1 second to execute date.

Related Question