From owner-freebsd-current@FreeBSD.ORG Thu Oct 27 13:04:07 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C3F4516A41F; Thu, 27 Oct 2005 13:04:07 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BB0443D46; Thu, 27 Oct 2005 13:04:07 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id CCBDE46BA2; Thu, 27 Oct 2005 09:04:05 -0400 (EDT) Date: Thu, 27 Oct 2005 14:04:05 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Poul-Henning Kamp In-Reply-To: <21905.1130409449@critter.freebsd.dk> Message-ID: <20051027140031.L32255@fledge.watson.org> References: <21905.1130409449@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: David Xu , Marian Hettwer , current@freebsd.org Subject: Re: MySQL Performance 6.0rc1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2005 13:04:07 -0000 On Thu, 27 Oct 2005, Poul-Henning Kamp wrote: >>> Why would anybody take a timestamp at all I/O syscalls ? >>> >>> "I wonder why my car can only go 30 km/h with the trunk full of >>> concrete" ? >>> >>> In a data base application I could possibly understand a timestamp >>> after every write. >>> >>> But after _all_ I/O syscalls ? That's just plain stupid... >> >> Don't panic, I agree that is stupid code, but I can not change it, it >> is not written by me, sorry! > > I'm not panicing, I'm merely pointing out that we should not optimize > performance after bogus code but rather try to improve it. There is, of course, a tension in optimizing systems to speed up applications that have been optimized for other systems. :-) Sadly, POSIX doesn't say anything about how applications can express preferences about the cost and granularity of time measurement. It's long been an issue though: AFS used to do magic on many UNIX systems to expose a timer tick timestamp to user space from the kernel via a special magic page. This trick has been used lots of other places to, but worked on the assumption that an application would be willing to pay a lower cost to get a poor measurement of time frequently, rather than pay a higher cost to get a time measurement less frequently. For user space applications implementing network protocols, this is important since they do need accurate measurements of round-trip time in order to calculate bandwidth windows, etc. We almost want clock_gettime() with CLOCK_TENMS, or the like. Robert N M Watson