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
Benchmarking different dispatch types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-01-18 (16:56)
From: William D. Neumann <wneumann@c...>
Subject: Re: [Caml-list] Benchmarking different dispatch types
On Wed, 17 Jan 2007, Nathaniel Gray wrote:

> Interesting, but are they meaningful?  The warnings from Benchmark are
> troubling, but I didn't have any immediate ideas on how to get rid of
> them.  Any suggestions?

Well, looking at the benchmark module, it appears that message if one or 
more of the following occurs:
The number of iterations is too low (default minimum = 4)
The amount of cpu time taken is too low (default minimum = 0.4 seconds)
The wallclock time was less than 1 second and the number of iterations was 
less than 1000.

So either make the functions more intensive (which obscures the calling 
time and thus is bad here), do more calls, or supply a smaller value for 

let _ =
   let results = latencyN 4000000 ~min_cpu:0.1
      [("function", call_f, ());
       ("method", call_o, ());
       ("closure", call_fc, ());
       ("obj. closure", call_foc, ())]
   tabulate results;;

William D. Neumann


"There's just so many extra children, we could just feed the
children to these tigers.  We don't need them, we're not doing 
anything with them.

Tigers are noble and sleek; children are loud and messy."

         -- Neko Case

Life is unfair.  Kill yourself or get over it.
 	-- Black Box Recorder