Timers and timing, was: MySQL Performance 6.0rc1

Katu boynagar at gmail.com
Fri Oct 28 01:14:36 PDT 2005


On 10/28/05, Chuck Swiger <cswiger at 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 from
> >>> 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 times
> per host shows the null function time value is stable to two digits, or three
> 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


More information about the freebsd-current mailing list