From owner-freebsd-hackers@FreeBSD.ORG Fri May 16 00:59:55 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2450837B40F for ; Fri, 16 May 2003 00:59:55 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2E3C743F85 for ; Fri, 16 May 2003 00:59:54 -0700 (PDT) (envelope-from phk@phk.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.9/8.12.9) with ESMTP id h4G7xqxm008316 for ; Fri, 16 May 2003 09:59:52 +0200 (CEST) (envelope-from phk@phk.freebsd.dk) To: freebsd-hackers@freebsd.org From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 16 May 2003 09:07:32 +0200." <20030516070732.GT45118@garage.freebsd.pl> Date: Fri, 16 May 2003 09:59:52 +0200 Message-ID: <8315.1053071992@critter.freebsd.dk> Subject: Re: Optimizations. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 May 2003 07:59:55 -0000 In message <20030516070732.GT45118@garage.freebsd.pl>, Pawel Jakub Dawidek writ es: >On Thu, May 15, 2003 at 11:14:43PM -0700, Terry Lambert wrote: >+> What about "gettimeofday()"? There are a number of applications, >+> particularly HTTP protocol applications, with strict timestamp >+> logging requirements, mandated by standards. The tend to call >+> gettimeofday() up to six times per transaction. Examples will >+> include HTTP proxies, L7 load balancers, and proxy caches. Any >+> box competing in the Cisco CSS/F5 falls into this category. Terry, you should have your own late-night chat show. That way you could be funny for the people who have nothing else to do than watch late-night television showing ill informed people trying to be funny without knowing what they talk about. More importantly, it would remove you from where I have to listen to your silly drivel. Even a cursory glance at our source code, something I am of course fully aware that you are not guilty off, would teach you a few interesting facts, something I'm equally aware that you have successfully resisted for the last 10 years. But for the benefit of the remainder of hackers@: gettimeofday() is the least of apaches problems: It is already a totally lockless systemcall. >That's right:) >Look at functions in /sys/kern/kern_tc.c. There are so many little >functions. How about put __inline here and there? Try it, and you'll find that things get slower because the code gets bigger. >And second thing. Does anybody think about representing time in BCD code? Yes, I remember when we did things like that, on computers which operated naturally on BCD fields, and therefore tended to have a chance of calculating delta-times in finite times. Modern computers however, are binary. -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.