Computer Chess Club Archives


Search

Terms

Messages

Subject: Ask experience of inline in C++?

Author: Pham Minh Tri

Date: 21:36:09 05/07/01


Hi,

I write my chess program in C++ (compile by VC6.0). To speed up, I have managed
to use as many inlines (both implicit and explicit) as posible. Many pieces of
code have the following form:

class abc {
  void A(int x) { do something. There are 100 places use x; }
  void B() { A(exp); }
};

(When I call function B, it calls function A with parameter of a short
expression).

Now I am wondering that compiler may embed directly the expression of parameter
from function B into A, it means instead of calling that expression one time and
use its results 100 times, now I may waste time by calling it 100 times!!!

Does anyone has experience about this problem? What exactly the compiler (Visual
C 6.0) do for this case? (Don't tell your guess, plz).

Many thanks in advance,
Pham



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.