[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: avoiding 'static inline'

From: Bruno Haible
Subject: Re: avoiding 'static inline'
Date: Sun, 19 Aug 2012 22:30:18 +0200
User-agent: KMail/4.7.4 (Linux/3.1.10-1.9-desktop; KDE/4.7.4; x86_64; ; )

Hi Simon,

I have to disagree with your statements:

> I have always found inline to be a waste of maintainer time due to all
> portability issues.

'static inline' is portable (assuming you use AC_C_INLINE).

'extern inline' has been made portable by Paul's new 'extern-inline'

The only maintainer time you spend is to determine whether it's worth
using inline. In the best case, you make an educated guess. In the worst
case, you compile the code with "-O2 -S" once and look at the size of the
inlinable function. This is not a hassle.

> If performance is critical, you are usually better
> of moving to hand-written assembler with a fall-back to a portable C
> implementation.

If you can gain 10% of speed just by placing a few 'inline' keywords here
and there (takes 15 minutes on a 200 KB large program), then why not do it?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]