Mail Archives: cygwin/2002/06/05/23:32:10
Was anyone able to resolve this issue? A few weeks
ago I posted about poor bash performance with "while
read" loops. Maybe this is the same issue...
Anyway, I hadn't upgraded my cygwin1.dll for quite a
long time, but when I did, some of my shell scripts
started to have horrible performance. I tracked it
down to the "while read" loops. I wrote the following
benchmark shell script to see how bad the problem
really is. On my PII-333 running Win-ME, I get the
following results:
# time ./doit 1
real 0m3.555s
user 0m0.000s
sys 0m0.000s
# time ./doit 2
real 0m22.870s
user 0m0.000s
sys 0m0.000s
When I run the same benchmark on a linux machine, I
don't get nearly as big a difference between the two
runs.
It would be really great if one of the crack
programmers who work on cygwin could look into this.
I imagine that everyone who uses cygwin would
appreciate a performance boost!
Anyway, here's the benchmark shell script. Thanks.
-Russ
#!/bin/bash
#
# benchmark piping into "while read"
#
# "doit 1" is the "first pass" which benchmarks
# generating output with the nested for-loops
#
# "doit 2" is the "second pass" which adds on the
# "while read" loop
#
# check usage
if test $# -ne 1; then
echo "usage: doit {1|2}"
exit 1
fi
# first pass: generate a bunch of output
for i in 1 2 3 4 5 6 7 8 9 0; do
for j in 1 2 3 4 5 6 7 8 9 0; do
for k in 1 2 3 4 5 6 7 8 9 0; do
for l in 1 2 3 4 5 6 7 8 9 0; do
echo hi
done
done
done
done |
# second pass: the "while read" loop
if test $1 != 2; then
cat - > /dev/null
else
while read JUNK; do
A=1
done
fi
> At 11:42 PM 5/29/2002, Johnny D wrote:
>
> >I am not sure when this bug might have been
> introduced. I have an app which deals with multiple
> socket descriptors for reads and writes. It uses the
> select() function call from cygwin library. I took
> the same source code - compiled it with a newer
> installaion of Cygwin (1.3.10 based). I see that
> the select call seems to be getting stuck at points
> and so the performance of my server has dropped thru
> the floor.
> >I dont have an older installation currently that I
> can use and I couldnt figure out how to get an older
> version of your package from the cygwin website. I
> urgently need to get this resolved. Prefer to have
> the complete Cygwin package dating close to Dec 2000
> (whcih is the last best known version of Cygwin that
> is known to work fine for me). Can someone point me
> to the right location from which I can install the
> same?
> >Or if this is a known issue, does anyone have a
> patch I could use?
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -