Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Object-oriented access bottleneck
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@o...>
Subject: Re: [Caml-list] Object-oriented access bottleneck
On Mon, 2003-12-08 at 06:30, Brian Hurt wrote:
> On Sun, 7 Dec 2003, Nuutti Kotivuori wrote:

> I actually question the value of inlining as a performance improvement, 
> unless it leads to other signifigant optimizations. 

Hmm. A block of n instructions containing a call to a block
of m instructions is typically n + 1 + m + 1 instructions:
at least a call and return are saved, even with no parameters.

I guess your analysis might be right if a function is
called more than once .. but for a single call,
inlining surely must be better.

In C++ there is no doubt that inlining is not just
an optimisation but a mandatory feature: several
classes of code, including wrappers 
(eg smart pointers) and of course constructors,
require inlining or the coding style is useless.

Of course, this is at a higher level than machine
code subroutine inlining .. a lot more than
just 2 instructions are saved (for example,
default constructors are often NOPs ..)


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners