To compare the network performance of Cygwin and native WinSock, I wrote the attached code.
Under the three compiler (MinGW 1.1 GCC 2.95, Cygwin GCC 2.95, GCC 2.96 of Red Hat 7.1) I used, I typed only "gcc -Wall fakeweb.c -o fakeweb" to build. Then I used a Web stress tool to send HTTP GET requests repeatedly (like ApacheBench, try "ab -n 100 -c 1 x.x.x.x/" on a Linux box). To my great surprise, the close(socket) operation took EXTREMELY long. It took 0.11 second (CPU usage was low), while this operation under MinGW 1.1 on the same machine took only 0.00019 second. On another Linux machine, close took 0.000043 second. Another problem concerns signal handling. This program could be stopped by CTRL-C under MinGW and Linux, but it hung and used 100% of CPU under Cygwin when CTRL-C was hit. Any help? Best regards, Wu Yongwei P.S. On a last test, one strange thing happened. If I reload 127.0.0.1 in a local browser quickly while running fakeweb, the displayed close time is much smaller. It does not work on a remote browser. Just wrote it here and does not expect an explanation for this point.
fakeweb.c
Description: Binary data
pctimer.h
Description: Binary data
-- 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/