From owner-freebsd-hackers@FreeBSD.ORG Wed Sep 7 00:49:03 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 507D51065782; Wed, 7 Sep 2011 00:49:03 +0000 (UTC) (envelope-from manishv@lineratesystems.com) Received: from mail-yi0-f54.google.com (mail-yi0-f54.google.com [209.85.218.54]) by mx1.freebsd.org (Postfix) with ESMTP id 05AA28FC0C; Wed, 7 Sep 2011 00:49:02 +0000 (UTC) Received: by yib19 with SMTP id 19so5310947yib.13 for ; Tue, 06 Sep 2011 17:49:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.42.145.197 with SMTP id g5mr2987565icv.348.1315356541950; Tue, 06 Sep 2011 17:49:01 -0700 (PDT) Received: by 10.42.19.196 with HTTP; Tue, 6 Sep 2011 17:49:01 -0700 (PDT) In-Reply-To: References: <20110906220115.GA25048@freebsd.org> Date: Tue, 6 Sep 2011 18:49:01 -0600 Message-ID: From: Manish Vachharajani To: Eitan Adler Content-Type: text/plain; charset=ISO-8859-1 Cc: Alexander Best , freebsd-hackers@freebsd.org Subject: Re: excessive use of gettimeofday(2) and other syscalls 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: Wed, 07 Sep 2011 00:49:03 -0000 I believe that Linux uses a less precise clock that scales better across cores and is much faster than the precise clock FreeBSD uses even on one core. I don't know POSIX and other standards well enough to know if this is an acceptable solution on FreeBSD. However, there are less precise clocks on FreeBSD that are considerably faster (i.e., the _FAST variants). Someone with more expertise in these matters needs to comment on whether a change to using a _FAST clock is appropriate in libc. If it is acceptable, I think that it is easier to just make time use the FAST clock instead of getting programmers to change their programs. On Tue, Sep 6, 2011 at 6:41 PM, Eitan Adler wrote: > On Tue, Sep 6, 2011 at 6:44 PM, Manish Vachharajani > wrote: >> Lots of libraries assume that time is fast because it >> is fast under Linux. > > Silly question, but why can't we make it fast too? > > -- > Eitan Adler > Manish