Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Oct 2005 13:14:27 +0500
From:      Katu <boynagar@gmail.com>
To:        current@freebsd.org
Subject:   Re: Timers and timing, was: MySQL Performance 6.0rc1
Message-ID:  <f0d84caa0510280114wc92de68m57e3aa6d88b2b795@mail.gmail.com>
In-Reply-To: <43613541.7030009@mac.com>
References:  <21137.1130401220@critter.freebsd.dk> <00a801c5dacf$db3b7700$6504010a@Jura> <43613541.7030009@mac.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 10/28/05, Chuck Swiger <cswiger@mac.com> wrote:
> Yuriy N. Shkandybin wrote:
> >>> Check gettimeofday syscall, it follows every I/O syscall, I think
> >>> our gettimeofday is tooooooo expensive, if we can directly get time f=
rom
> >>> memory, the performance will be improved further.
> >
> > It's true:
> > run next on same PC -- freebsd and linux and compare
> [ ...snippet of timing code deleted, see attachment instead... :-) ]
>
> FreeBSD 4.11-STABLE i386
>         null function: 0.01069
>              getpid(): 0.51729
>                time(): 3.51727
>        gettimeofday(): 3.48715
>
> FreeBSD 5.4-STABLE i386
>         null function: 0.01278
>              getpid(): 0.51329
>                time(): 2.54771
>        gettimeofday(): 2.54982
>
> Linux 2.6.5 i686
>         null function: 0.01858
>              getpid(): 0.01979
>                time(): 0.44811
>        gettimeofday(): 0.55776
>
> Darwin 8.2.0 Power Macintosh
>         null function: 0.01889
>              getpid(): 0.03590
>                time(): 0.20913
>        gettimeofday(): 0.17278
>
> SunOS 5.8 sun4u
>         null function: 0.05051
>              getpid(): 1.29846
>                time(): 1.26596
>        gettimeofday(): 0.29507
>
> [ These are representative results (in seconds); running the test three t=
imes
> per host shows the null function time value is stable to two digits, or t=
hree
> on some hosts; the other values seem to vary by less than 10%. ]
>
> The Intel boxes are all Intel P3, between 700MHz and 1Ghz, the Sun is a
> dual-proc E450 @ 450MHz, and the other is a Mac Mini @ 1.3Ghz, I think.
>
> Real numbers are are well and good, but I don't want to start yet another
> thread about microbenchmarks or statistics.

Dual CPU Pentium II 300 MHz running FreeBSD 6.0-RC-1, almost GENERIC kernel=
:
       null function: 0.00686
            getpid(): 1.72151
              time(): 4.57979
      gettimeofday(): 4.45133

Same machine under Gentoo Linux (kernel 2.6.10):
       null function: 0.00678
            getpid(): 0.04737
              time(): 1.09754
      gettimeofday(): 1.36030



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?f0d84caa0510280114wc92de68m57e3aa6d88b2b795>