www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/09/07:36:36

Date: Sun, 09 Sep 2001 14:31:21 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "Raf256" <raf256 AT go2 DOT pl>
Message-Id: <2593-Sun09Sep2001143121+0300-eliz@is.elta.co.il>
X-Mailer: Emacs 20.6 (via feedmail 8.3.emacs20_6 I) and Blat ver 1.8.9
CC: djgpp AT delorie DOT com
In-reply-to: <3b9b36a7$1@news.vogel.pl> (raf256@go2.pl)
Subject: Re: ilnine ?
References: <3b9b36a7$1 AT news DOT vogel DOT pl>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From: "Raf256" <raf256 AT go2 DOT pl>
> Newsgroups: comp.os.msdos.djgpp
> Date: Sun, 9 Sep 2001 11:29:37 +0200
> 
> why use 'inline' statment ? If compiler is good enought, it sholud give same
> result if functions are and aren't inline, when optimization for speed is
> checked...

The compiler won't inline functions unless you use the "-O3" switch.
However, the current optimization technology is not smart enough to
find functions that can benefit from inlining.  So the compiler
inlines all the function in sight, and that generally makes your
program slower.  For that reason, you are well advised to compile with
"-O2" (which does not inline automatically), but declare inline only
those functions you know are will be called in the inner loops.

The above is true for C programs.  Things are a bit different in C++,
where class methods are inlined even with "-O2", as if they were
declared inline.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019