From owner-freebsd-questions@FreeBSD.ORG Fri Jun 6 01:25:54 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E321065680 for ; Fri, 6 Jun 2008 01:25:54 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id EA06E8FC12; Fri, 6 Jun 2008 01:25:52 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <48489222.7020501@FreeBSD.org> Date: Fri, 06 Jun 2008 03:25:54 +0200 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Kirk Strauser References: <200806051508.29424.kirk@strauser.com> <4848523E.2010604@FreeBSD.org> <200806051617.54400.kirk@strauser.com> <484867E3.3070705@FreeBSD.org> <4848757B.30408@strauser.com> In-Reply-To: <4848757B.30408@strauser.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Poor read() performance, and I can't profile it X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Jun 2008 01:25:54 -0000 Kirk Strauser wrote: > Kris Kennaway wrote: > >> No, if it's reading in 16 byte units it will explain the terrible >> performance. > > No, it's actually doing 4096-byte reads. That was just an example of > what I meant. I don't understand what you meant by "It's also doing a lot of lseek()s to what is likely the current position anyway (example: seek to 0x00, read 16 bytes, seek to 0x10, etc.)." then. Please show a typical part of the ktrace output. Kris > Since I wrote that, though, I wrote a program to do > 1,000,000 seeks to position 0, and it ran immeasurably fast. I'm > guessing that lseek() is optimized to not do anything if you ask it to > move to the position you're already at. > > Any other thoughts? There definitely aren't any setbuf() calls, and no > matter what it still takes 100 times more kernel overhead on Linux than > FreeBSD. Speaking of which, I think my next experiment will be to try > the Linux binaries on FreeBSD and see if it behaves similarly.