Bash / cygwin process spawning (?) performance very slow

Marco Atzeri marco.atzeri@gmail.com
Wed Sep 23 09:29:00 GMT 2015


On 23/09/2015 10:52, litter@null.net wrote:
> Hi all,
>
> I noticed that doing simple loops in Bash takes unexpectedly long under Cygwin on a Windows XP 32 bit machine
> (CYGWIN_NT-5.1 <machine> 2.2.1(0.289/5/3) 2015-08-20 11:40 i686 Cygwin)
>
> I already followed the FAQ advice in trying to determine general causes, and made a 'shadow' copy of /etc/passwd as described.
> My PATH does not contain references to network shares.
>
> Still quite normal commands take a long time e.g.
> time cat some-file | while read i;do echo $i;/bin/true;done
>
> real 1m44.953s
> user 0m9.599s
> sys 1m36.865s
>
> for a file of 167 lines. Process Explorer showed a CPU load of 20% on bash.exe, which was almost completely Kernel time.
> Is such high Kernel load normal?

may be. forks are time consuming and your command is spending all the
time in fork

In addition, I suspect your Antivirus is further slowing down the things.

> I know it's a bit like comparing apples to oranges, but I run the SAME command from the same disk, from within a Debian 7 486 Linux on VirtualBox (!) on the same machine, it gave
> real 0m3.871s
> user 0m0.160s
> sys 0m3.292s
>
> So even running in emulator, real/user/sys time are about 30/60/30 times faster. That's quite shocking.
> Is this performance to be expected? That would make it an obvious choice to switch to VirtualBox on this machine.

I have much better results with my cygwin
also with a much longer file

$ wc -l cygcheck.out
5220 cygcheck.out

$ time cat cygcheck.out  | while read i;do grep text $i;done
..
real    0m0.288s
user    0m0.015s
sys     0m0.262s

$ time  awk '{if ($1 ~ /text/) print $1}' cygcheck.out
...
real    0m0.076s
user    0m0.015s
sys     0m0.046s


> Thanks,
> Paul

for every job there is the right tool
:-0

Regards
Marco





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list