caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Caml Light performance tests?
@ 1996-03-12  5:29 Mark Hayden
  0 siblings, 0 replies; only message in thread
From: Mark Hayden @ 1996-03-12  5:29 UTC (permalink / raw)
  To: caml-list; +Cc: hayden



Hi,
  I'm fine-tuning a program that compiles with both Caml Light and Caml
Special Light.  In doing so, I've made lots of guesses about the relative
performance of different coding styles.  I'm thinking of putting together
some performance tests to eliminate my guesswork.  As you'll see, I'm not
interested in real application benchmarks, but just the relative costs of,
for instance, iterating over a vector with "do_vect" verses an explicit
"for" loop.  I have several questions for the Caml Light community:

  * Has anyone else already made such tests?  (If so, what
    were the results and is the code available?)

  * What are the issues for the cases below?

  * Are there suggestions for other interesting tests?
  
thanks,
  Mark



options:
  Caml Light, CSL-byte, CSL-native
  safe & unsafe
  architecture (I'm interesting in sparc 20s)

1.
  let f = fun x -> ... in
  ...
  
  do_vect f v

    VS

  do_vect (fun x -> ... ) v ;

    VS 

  for i = 0 to pred (vect_length v) do
    ...
  done 

2.

  do_list (fun x -> ... ) l

    VS 

  let rec loop = function
    | [] -> ()
    | hd::tl -> (
	... ; 
	loop tl
      )
  in loop l

3. 

  let g = f x in
  for i = 1 to 1000 do
    g y
  done

    VS

  for i = 1 to 1000 do
    f x y
  done

4.

  let f () =
    if ... then None
    else Some ...
  in

  for i = 1 to 1000 do
    match f () with
    | None -> ()
    | Some x -> ...
  done

    VS

  let f g =
    if ... then g ...
  in

  for i = 1 to 1000 do
    f (fun x -> ...)
  done


4. cost of calling identity function

5. cost of an additional argument to a function

6. overhead of calling an external C function

7. cost of a let binding (is there any?)





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-03-12 15:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-03-12  5:29 Caml Light performance tests? Mark Hayden

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).