From owner-freebsd-current@FreeBSD.ORG Fri Oct 28 10:34:51 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1A6C116A41F; Fri, 28 Oct 2005 10:34:51 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from phk.freebsd.dk (phk.freebsd.dk [130.225.244.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id B402043D4C; Fri, 28 Oct 2005 10:34:50 +0000 (GMT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (unknown [192.168.48.2]) by phk.freebsd.dk (Postfix) with ESMTP id 5C199BC50; Fri, 28 Oct 2005 10:34:49 +0000 (UTC) To: David Xu From: "Poul-Henning Kamp" In-Reply-To: Your message of "Fri, 28 Oct 2005 18:30:22 +0800." <4361FDBE.7000500@freebsd.org> Date: Fri, 28 Oct 2005 12:34:48 +0200 Message-ID: <31129.1130495688@critter.freebsd.dk> Sender: phk@critter.freebsd.dk Cc: Pertti Kosunen , current@freebsd.org, "Yuriy N. Shkandybin" Subject: Re: Timers and timing, was: MySQL Performance 6.0rc1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Oct 2005 10:34:51 -0000 In message <4361FDBE.7000500@freebsd.org>, David Xu writes: >Now, I can confirm mysqld calls time() function lots of time, I have >changed time() to call clock_gettime, now there is few of gettimeofday >in ktrace result, but fully filled by clock_gettime. the correct way to optimize this would be to add a time(2) systemcall which returns the value of the kernel global time_second. -- 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.