cvs commit: src/sys/dev/lnc if_lnc.c

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Jul 22 09:42:26 PDT 2003


In message <20030722163007.GA6080 at HAL9000.homeunix.com>, David Schultz writes:

>The cost of not inlining is insignificant on i386, but it can be
>very significant on architectures with sliding register windows,
>such as sparc64.  On sparc64, a trap is taken every time the
>procedure call depth changes by more than 6.  An inlining can mean
>the difference between super-efficient procedure calls and having
>to slide the register window back and forth at great penalty.

Fine, but if you are not able to measure the difference and the
code is bigger, is it worth it ?

Considering that modern CPU caches are about an order of magnitude
to small to avoid being a performance throttle, I think code size
will prove to be a more significant issue on all current platforms.

I agree that constant propagation is a worthwhile reason, but I will
still tend to think that if it increases code size for no measurable
performance gain, we're on slippery slope...

>There is reason for concern about cases where inline really is
>misused, either because it massively increases code size or
>because it is unimportant to performance and detracts from
>debuggability.

Here we agree.

>[1] In practice, just about any contentious case of inlining is
>    going to be a wash anyway, and neither side of the argument
>    is entirely without merit.  I'm mostly opposed to a new policy
>    on the grounds that it's just another stupid rule, complete
>    with technicolor bikesheds, to throw in the faces of people
>    trying to do something useful.

I far prefer to just fix the problems, but clearly the sort of
inline (and register) use we have in the tree indicates that at
least some of our contributors are in need of a guideline for
when to inline things.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the cvs-all mailing list