This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: select() too slow


Hello again,

as promised attached you will find a very simplistic non-blocking echo server that compiles on Linux and Cygwin.
The main objective is that you compile it and run on both environments.
Of course that the same hardware is recommended in order to compare the results in a more accurate way.


After compile and run it, on a different machine you do something like:

$ time cat big_file | nc –w 1 echo_server_ip_address port > dest_file

On my test a big_file of 100 mb toke 22 seconds on Linux and 4 minutes on Cygwin.

This is my problem, why it takes so much more time on Cygwin?
There is any obvious wrong thing I'm doing?
It seems to be a select() problem.

Thanks in advance,

Pedro Inacio

Attachment: echo_server.c
Description: Binary data


On 2006/03/11, at 18:16, Christopher Faylor wrote:


On Sat, Mar 11, 2006 at 06:04:37PM +0000, Pedro Inacio wrote:
On 2006/03/11, at 15:40, Eric Blake wrote:


I'm afraid that this is not a very good bug report, as you have not
attempted to describe WHAT is too slow, and have not provided a simple
test case that compiles out of the box, with timing numbers on the
test
case compared between Linux and Cygwin. Cygwin is only as fast as the
underlying Windows system calls permit it to be. Also, cygwin is open
source. Go look at the source code to select() and you will see
that it
is very complex, since Windows does not provide good hooks for an
efficient implementation. If you would like it to be faster, then
consider writing a patch to cygwin that can speed it up.

first of all this is not a bug report, but just trying to understand
what might be the problem. If I knew what the problem is I was not
asking if there is any known issue, a fix, or something. I've read the
archives before posting and there are some guys with similar problems
but no answers.

But we don't know what the actual problem *is*. What does "too slow"
mean? select takes an extra twenty milliseconds under Cygwin? select doesn't
respond within 24 hours?


You are apparently a programmer because you know about select(). Think
of this from the point of view of someone reporting a problem with your
software. Wouldn't you ask them for more details if the bug report was
merely "Your program is slow?"


I know that the select() function on windows is quite different

It is different to the point of being nonexistent -- except for sockets.


and not very handy.  One thing is weird for sure, similar code works
just fine on Unix but is not very performante on Windows.

Whether it is a bug report or not, you haven't given enough details for
anyone to comprehend what you are talking about.


Your email seems to have been sent with an understanding that everyone
will just automatically understand what you're talking about.  That
is not the case.  You can't take shortcuts to describing a problem if
you truly want help.  You haven't provided enough information to even
provide a WAG.

cgf

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



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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]