Re: A patch for linux 2.1.127

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Tue, 10 Nov 1998 07:41:30 +0000


On Mon, Nov 09, 1998 at 04:52:46PM +0100, Peter T. Breuer wrote:
> The knowledgeable user relies on the knowledgable compiler here. All
> studies show that hand-optimizing code is a waste of effort 99.99% of
> the time, not least because it's unmaintainable. Experience says so
> too. I've regretted every "optimization" I've ever done.

I disagree. While most non-algorithmic optimisations probably aren't
worth the effort, there are a few tricks of the trade that are very easy
and really make the performance difference. (With present technology).

One of these is dividing a function into a common case which runs fast,
and a general case which runs slower. Adding the keyword "inline" when
the common case code is tiny is just a final tweak. Really, the
compiler could inline those tiny functions itself; the problem is that
the compiler doesn't know that the general case will only be called
rarely. (Profile driven compilation may fix this, but the technology's
not readily available yet).

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/