From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 27 16:09:27 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 95E5A16A420 for ; Mon, 27 Feb 2006 16:09:27 +0000 (GMT) (envelope-from vladgalu@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 30FAB43D45 for ; Mon, 27 Feb 2006 16:09:27 +0000 (GMT) (envelope-from vladgalu@gmail.com) Received: by zproxy.gmail.com with SMTP id x3so923299nzd for ; Mon, 27 Feb 2006 08:09:26 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=oV7WCmgTlkhA6u7p31EhJfT8o0EV5/Z/3cCRNndkXUQBeKcTcvDke3QTxUPSB8daC2I8K0DqXbrM7Yu2LAk4kAWEOnBXDyO0vbgbhFRu8fsTpgHQwk3yGFdKEzNPJ+Bf0xbp/5cT1b/VWN1kAn7d9C6qeBtn6w68eWFug3nB++o= Received: by 10.35.49.4 with SMTP id b4mr2068604pyk; Mon, 27 Feb 2006 08:09:26 -0800 (PST) Received: by 10.35.38.9 with HTTP; Mon, 27 Feb 2006 08:09:26 -0800 (PST) Message-ID: <79722fad0602270809p2229db83i5cb4cf0b24f91828@mail.gmail.com> Date: Mon, 27 Feb 2006 18:09:26 +0200 From: "Vlad GALU" To: "freebsd hackers" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: Fastest timecounter ? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2006 16:09:27 -0000 Dear hackers, I'm in a dilemma (more like a trilemma, actually). While following the 5.x and 6.x development cycle I observed that the default timecounter varies from one machine from another (for instance on my home desktop which is an AMD Athlon 2400+ it uses ACPI-fast, whereas on my Centrino-powered lappie it likes TSC better). I wrote a piece of software that has to get the current timestamp, one way or the other, a huge number of times per second. Apart from the empyrical tests one can perform to find out the timekeeping scheme with the less performance impact, is there any rule of thumb as to what choice to go for ? Any kind of advice is most welcome, especially reading material. P.S. I know that some of you may say that calling gettimeofday() that often is braindead, and at some point I agree. Unfortunatley, right now I can't do anything better. I need timekeeping to comb the algorithms that deal with my data structures a bit more, after which I can switch to time-related optimizations. -- If it's there, and you can see it, it's real. If it's not there, and you can see it, it's virtual. If it's there, and you can't see it, it's transparent. If it's not there, and you can't see it, you erased it.