Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Nov 1996 20:49:01 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, thorpej@nas.nasa.gov
Cc:        freebsd-bugs@freefall.freebsd.org
Subject:   Re: misc/2007: /usr/include/sys lacking timer arithmetic functions..
Message-ID:  <199611150949.UAA07422@godzilla.zeta.org.au>

index | next in thread | raw e-mail

[timeval arithmetic macros in <sys/time.h>
>NetBSD added these because there were a zillion places where timeval
>arithmetic was implemented in the kernel.  Centralizing it reduced
>code complexity, which is generally considered a good thing.

The kernel just uses functions in FreeBSD and NetBSD-old.

>They aren't function calls.  Everything is done inline, so there's no
>additional cost associated with using the abstraction.

There's the extra cost of inlining - potentially busted caches if the
inline code is larger than the code to call the function.  Code that
is duplicated in a zillion places is the worst candidate for inlining
because the chance of any one block of inline staying in a cache is
smaller.  I think timeval arithmetic isn't done often enough for
inlining to matter, so using function calls is best because it is
simpler.

Bruce


home | help

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