From owner-freebsd-bugs Sun Feb 3 15: 0: 6 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B6ACC37B421 for ; Sun, 3 Feb 2002 15:00:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g13N01x67943; Sun, 3 Feb 2002 15:00:01 -0800 (PST) (envelope-from gnats) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 115A837B41C for ; Sun, 3 Feb 2002 14:57:31 -0800 (PST) Received: (from nobody@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g13MvVa66671; Sun, 3 Feb 2002 14:57:31 -0800 (PST) (envelope-from nobody) Message-Id: <200202032257.g13MvVa66671@freefall.freebsd.org> Date: Sun, 3 Feb 2002 14:57:31 -0800 (PST) From: Jason Carroll To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-1.0 Subject: misc/34596: slow gettimeofday in FreeBSD 4.5 Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 34596 >Category: misc >Synopsis: slow gettimeofday in FreeBSD 4.5 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Feb 03 15:00:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Jason Carroll >Release: FreeBSD 4.5 >Organization: >Environment: FreeBSD galois 4.5-RELEASE FreeBSD 4.5-RELEASE #0: Sat Feb 2 16:28:26 EST 2002 jason@galois:/usr/obj/usr/src/sys/LOCAL i386 (I also tried this with the GENERIC kernel that came with the 4.5 release) >Description: gettimeofday() seems to be slower (by about 5 times) than it was under FreeBSD 4.2. I ran the program below on an Intel 1.9ghz machine with 4.5 FreeBSD installed (with the GENERIC kernel), and it took approximately 5 seconds, or 5ms per call to gettimeofday. I then boot the same machine with a 4.2 kernel and the same program ran in under 1 second. See the next window for the program source. Any ideas? This doesn't seem like a critical problem, but I thought it should be mentioned. Thanks >How-To-Repeat: #include #include int main(int argc, char *argv[]) { timeval tv, st, en; gettimeofday(&st, NULL); for (int i = 0; i < 1000000; i++) { gettimeofday(&tv, NULL); } gettimeofday(&en, NULL); printf("delta: %ds %dus\n", en.tv_sec- st.tv_sec, en.tv_usec - st.tv_usec); } >Fix: >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message