delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/02/08/06:56:52

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Fri, 8 Feb 2002 12:55:56 +0100
From: Corinna Vinschen <cygwin AT cygwin DOT com>
To: cygwin <cygwin AT cygwin DOT com>
Subject: Re: unix domain socket with shared memory ?
Message-ID: <20020208125556.B12075@cygbert.vinschen.de>
Mail-Followup-To: cygwin <cygwin AT cygwin DOT com>
References: <20020207161446 DOT C14241 AT cygbert DOT vinschen DOT de> <000501c1b02a$8b4e15f0$f88cfea9 AT BRAMSCHE>
Mime-Version: 1.0
In-Reply-To: <000501c1b02a$8b4e15f0$f88cfea9@BRAMSCHE>
User-Agent: Mutt/1.3.22.1i

On Thu, Feb 07, 2002 at 11:55:31PM +0100, Ralf Habacker wrote:
> One question: Does unix domain sockets uses localhost address ? net.cc:cygwin_socketpair() seems to use first an ip
> adress of zero and later the loopback address. Could this have an effect ?

Nope.  It's probably more secure to use INADDR_LOOPBACK here but
it has nothing to do with speed.

> I have tried to replace the locations using INADDR_ANY with htonl (INADDR_LOOPBACK) but recognized no changes.

I would have lost a bet if that had changed anything.

> If you look a little deeper you can see, that the read() in unix domain socket benchmark returns only 32708 bytes
> 
>  1966 1981317 [main] bw_unix 1788 _read: 32708 = read (3, 0xA012048, 65536), errno 0
> 
> while the read() in the tcp benchmark returns 65416
> 
>  2573 7229513 [main] bw_tcp 1792 _read: 65416 = read (3, 0xA012048, 65536), errno 0
> 
> and thats may be a reason for the performance difference.

Hmm, perhaps.  I've just checked in a fix which perhaps changes
that disproportion.  Could you please check with the latest from
CVS aggain?

> The main difference between the two benchmarks are the used device /dev/sockstream against /dev/tcp.
> But don't ask me about the reason why, now I'm left

That's easily to see in the sources.  net.cc?

> returned stable after a few (about 10) returns with the full buffer size of 65536 in the main benchmark loop. Could
> this be a bug in the winsock code or is it be caused by timing differences, because not all data is send early
> enough ? (There are 119 bytes  missed)

Dunno.  Winsock overhead, perhaps.

> BTW2:
> > I'm a bit surprised by your results, though.
> I'm additional surprised that the native unix domain sockets performance under cygwiwn is only 7% of the linux
> performance with the same hardware, while the tcp performance seems to be acceptable (64% of the linux
> performance). So my main target is to speed this up. :-)

That's not a surprise.  AF_LOCAL sockets are naturally equaly slow
or slower than AF_INET sockets on Cygwin (why?  Exercise for the
reader!) while they are a completely independent implementation
on Linux or other OSes.

Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin AT cygwin DOT com
Red Hat, Inc.

--
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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019