Re: A patch for linux 2.1.127

Steven Roberts (strobert@ata-sd.com)
Tue, 10 Nov 1998 18:03:16 -0800


"Peter T. Breuer" wrote:
> Too much. I rely on gcc (and other compilers) inlining functions that are
> only placeholders for other calls to optimize generated code.
>
> I need functions inlined if they're dead-ends, or call other functions
> and return the foreign result without further calculation. I.e. they
> don't need to save and restore registers because they're not using any.
> That's about a 3-4 times speedup win for me (my compiler-compilers ..).
> I produce lots of short functions from expression analysis. "a+b+c"
> might generate 6 functions, one for each subexpression and one for each
> referent.

Isn't that what the "inline" keyword is for???

Linus isn't saying the compiler should ignore the inline keyword, far
from it, he just doesn't want the compiler to inline things we don't
tell it to.
(Linus, please correct me if I am misrepresenting what you said)

I do a lot of C++ work and use inline's all over the place for real
quick functions that except for data abraction should just be straight
memory refs off of a struct. that is what I think inline's are great
for. And in these cases, I do get huge speed-ups (inlining operator []
on an array class for example)

But I know better than the compiler most of the time when something
should be inline'd or not (I've looked at the assembly output and have
had to tweak code to force a behavior that the compiler didn't do right,
so please don't tell me all compiler's get it right). Now I am using
Microsquish land compilers -- watcom, borland, microsoft -- (one of
these days I'll convince the field guys they don't need Word or Excel,
just a word proc and a spreadsheet, and I can use linux/X for the
platform, but that takes time :) ...)

Regards,
Steve Roberts

-
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/