Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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: 2003-12-08 (20:51)
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 Archives:
Bug reports: FAQ:
Beginner's list: