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
Comparison of OCaml and MLton for numerics
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-06-01 (23:44)
From: Brian Hurt <bhurt@s...>
Subject: Re: [Caml-list] Comparison of OCaml and MLton for numerics

On Sat, 2 Jun 2007, skaller wrote:

> On Fri, 2007-06-01 at 10:57 -0400, Brian Hurt wrote:
>>  And the third case, where inlining opens up new
>> possibilities for optimization- that almost has to be done by the
>> compiler, as it depends upon what optimizations the compiler can, and
>> will, apply to the newly inlined function.  This is something I trust
>> the compiler to do more than I trust even me to do correctly.
> It's NOT so easy to predict how much optimisation will result
> from inlining. Just think about it, you have a tree of inlining
> opportunities, if do you really want to attempt to estimate the
> coefficients on N inlining choices just to decide if you'll
> inline or not?

Nor is it easy for the programmer to guess how much optimization will 
result from inlining!  What with different compilers with different 
optimization strategies, complex interactions between compiler strategies, 
and even compiler strategies being enabled or disabled depending upon what 
compilation flags given.  Plus you have the effect of changing codes 
bases- any decision as to wether to inline or not has to be revisited 
every time either code changes.  Plus, the decision to inline is dependent 
upon code in probably widely disseperate locations.

> I doubt it. The compiler will make one guess whether to inline
> or not based on a some fast heuristic, and then commit.

Yep.  And I'm saying that heuristic is likely to be more accurate than the 
programmers guess.