From owner-freebsd-questions Tue May 15 10:37:20 2001 Delivered-To: freebsd-questions@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 6059637B422; Tue, 15 May 2001 10:37:16 -0700 (PDT) (envelope-from dillon@earth.backplane.com) Received: (from dillon@localhost) by earth.backplane.com (8.11.3/8.11.2) id f4FHbBL55271; Tue, 15 May 2001 10:37:11 -0700 (PDT) (envelope-from dillon) Date: Tue, 15 May 2001 10:37:11 -0700 (PDT) From: Matt Dillon Message-Id: <200105151737.f4FHbBL55271@earth.backplane.com> To: Terry Lambert Cc: dave , freebsd-questions@FreeBSD.ORG, arch@FreeBSD.ORG Subject: Re: Gettimeofday Again... References: <200105150337.UAA19677@gull.mail.pas.earthlink.net> <200105150346.f4F3kLE45720@earth.backplane.com> <3B00EF40.A1232B75@mindspring.com> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :I have an application where gettimeofday() was a significant :fraction of the overhead; it was being used to provide for :marketing eye-candy... basically, squid-compatible proxy :logging that could be processed using common eye-candy tools :normally used against squid logs for transaction in, time :sent to back end, time data came from back end, and time data :sent to client. : :The gettimeofday() calls were _the_ major useless overhead, :until I eliminated them by creating a zero system call version Terry, to be blunt... if you need performance you don't go making superfluous system calls for every transaction. If you want marketing eye candy, all you need to do is a statistical measurement... do fine measurement of 10% of the transactions rather then fine measurement of 100% of the transaction, and you are done. Also, using gettimeofday() is a ridiculous way to measure fine grained time billions of times in production code. I mean, sure, it works... but getitimer() is about 5 times faster. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message