From owner-freebsd-arch Sun Feb 17 23:24:40 2002 Delivered-To: freebsd-arch@freebsd.org Received: from falcon.prod.itd.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 6A29637B405; Sun, 17 Feb 2002 23:22:05 -0800 (PST) Received: from pool0305.cvx21-bradley.dialup.earthlink.net ([209.179.193.50] helo=mindspring.com) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16ci7b-0007YC-00; Sun, 17 Feb 2002 23:21:59 -0800 Message-ID: <3C70AB8B.96589869@mindspring.com> Date: Sun, 17 Feb 2002 23:21:47 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Evans Cc: Matthew Dillon , Poul-Henning Kamp , Julian Elischer , Alfred Perlstein , arch@FreeBSD.ORG, jhb@FreeBSD.ORG, peter@wemm.org, jake@locore.ca Subject: Re: gettimeofday() and crhold()/crfree() (was Re: gettimeofday()andcopyout().Is copyout() MPSAFE on non-i386 archs? ) References: <20020218151249.E4728-100000@gamplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Bruce Evans wrote: > On Sun, 17 Feb 2002, Matthew Dillon wrote: > > > Just a note: The gettimeofday() has an overhead of only 2-3 uS in > > -current. Squid would have to be doing an aweful lot of transactions > > And that is only on slow machines and/or under SMP. On my Athlon1600, > it has an overhead of 0.3-0.4 nsec. I have been benchmarking it for > many years and recently had to change the benchmark program to use > clock_gettime(2) instead of gettimeofday() when getttimeofday()'s > resolution became too small. .4nsec * 22,000 transactions/sec * 5 timestamps/transaction = 440us/sec spent on time stamps. Up that to 2uS and... = 220ms/sec on time stamps = ~1/4 of all available time spent on time stamps. [ ... other stuff not really applicable; can discuss why off list, if necessary ... ] -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message