From owner-cvs-all Fri Nov 6 04:32:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id EAA23787 for cvs-all-outgoing; Fri, 6 Nov 1998 04:32:21 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from implode.root.com (implode.root.com [198.145.90.17]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id EAA23782 for ; Fri, 6 Nov 1998 04:32:19 -0800 (PST) (envelope-from xroot@implode.root.com) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.5/8.8.5) with ESMTP id EAA15930; Fri, 6 Nov 1998 04:33:29 -0800 (PST) Message-Id: <199811061233.EAA15930@implode.root.com> To: Matthew Dillon cc: Marc Slemko , cvs-committers@FreeBSD.ORG Subject: Re: sendfile() In-reply-to: Your message of "Thu, 05 Nov 1998 23:23:59 PST." <199811060723.XAA01903@apollo.backplane.com> From: David Greenman Reply-To: dg@root.com Date: Fri, 06 Nov 1998 04:33:29 -0800 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk > Heh. Well, I wrote a little program to test the overhead of > sendfile() vs write() in the 100% cached case. The program > makes a tcp connection to another program that just sinks the > data. > > Over localhost (with the sink program running on the same > host), it's 9x more efficient to use sendfile(). Over > a 10BaseT Lan (with the sink program running on the > remote host) it's 2x and 2.8x more efficient using > sendfile(). A couple of comments about the benchmarks: having a process on the same machine sink the data will pessimize the results since there will be a kernel->user copy, even though the data is thrown away. The LAN test you did is unusually slow; on a P6/200 with 100Mbps DMA fast ether (fxp) talking to another machine as a data sink, I measured very close to 1/10th of the CPU consumption when sending a cached file vs. the same except using ttcp with a cached file (which does a read/write loop). -DG David Greenman Co-founder/Principal Architect, The FreeBSD Project To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message