select() too slow
Pedro Inacio
pedro.inacio@honeynet-pt.org
Tue Mar 14 18:59:00 GMT 2006
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: echo_server.c
Type: application/octet-stream
Size: 2376 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20060314/9b519f99/attachment.obj>
-------------- next part --------------
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/
>
-------------- next part --------------
--
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/
More information about the Cygwin
mailing list