Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!fstohp.crd.ge.com!keith From: keith@fstohp.crd.ge.com (Keith D Gregory) Newsgroups: comp.protocols.tcp-ip Subject: (none) Message-ID: <8905151447.AA24637@crdgw1.ge.com> Date: 15 May 89 14:48:51 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 42 Subject: Re: UDP Connections on LOOP interface joshua@atherton.com (Joshua Levy) writes: >What about the relative speeds? Do you have any idea how fast msgsnd >is compared to socket(127.0.0.1)? If so, I'd like to know. Thanks. The raw numbers I generated (all times in milliseconds): Method: UDP on 127.0.0.1 Number of packets: 1000 Maximum time: 39.956 Minumim time: 3.788 Average time: 4.064 Method: Sys5 Message Number of packets: 1000 Maximum time: 163.764 Minumim time: 2.966 Average time: 35.344 --------------------------------------------------------- The test programs were almost identical: a single program which fork()'d, the child wrote a bunch of packets, the parent tried to read them. The packets themselves contained the current time from gettimeofday(2), which was compared to the time after the read. The message version used blocking read/write (msgrcv, msgsnd). The UDP version used blocking write (sendto), and non-blocking read (recvfrom), initiated by a select(). To avoid queue overflow, the UDP version slept 1 second between sends (the select() was around to notify me if packets got lost - none did). The machine is an HP9000/360 (68030 @ 25MHz), running HP-UX 6.2. A few users at the time, doing the sorts of things that users do. Anyone that wants the source code should mail me directly, at 'keith%fstohp@crdgw1.ge.com'. -kdg