From owner-freebsd-questions Fri May 4 11:17:52 2001 Delivered-To: freebsd-questions@freebsd.org Received: from guru.mired.org (okc-65-26-235-186.mmcable.com [65.26.235.186]) by hub.freebsd.org (Postfix) with SMTP id 3C4A237B423 for ; Fri, 4 May 2001 11:17:49 -0700 (PDT) (envelope-from mwm@mired.org) Received: (qmail 12401 invoked by uid 100); 4 May 2001 18:17:44 -0000 From: Mike Meyer MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15090.62024.675629.309220@guru.mired.org> Date: Fri, 4 May 2001 13:17:44 -0500 To: dave Cc: questions@freebsd.org Subject: Re: Curious gettimeofday problem/issue In-Reply-To: <1313043@toto.iv> X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`;h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG dave types: > http://www-106.ibm.com/developerworks/linux/library/l-rt1/ > > Has an article using gettimeofday vs and a equivalent function in Windows > to test some aspects of system performance. There is a loop of > approximately 1 million calls to gettimeofday ran 20 times. Each of these > 1million calls has a final elapsed time and then the average time/call is > printed. The source for these tests is available at the above link. > > I decided to run this test with FBSD and was shocked and horrified. > > The tests that the author of the above article ran showed Linux to be 2.5 > times faster than Windows for that test. By the same token Linux was > shown to be more than 13 times faster than FBSD. > > Now this doesn't mean that all of FBSD is slower than linux but definitely > true on this test. > > gettimeofday is a glibc library call. Perhaps the way it gets its > information from the kernel is sub-optimal. Perhaps the kernel's way of > providing this information is sub-optimal. > > Or what I am really hoping is that my kernel is not optimally configured > and that someone else will run this test and show there is no > bug in the kernel or glibc. Something like this came up before, and the conclusion was that the linux gettimeofday library call was caching something that the FBSD version wasn't. You might try searching the list archives to see if that's relevant. http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message