From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id QAA07652 for caml-redistribution; Tue, 12 Mar 1996 16:38:01 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id GAA29064 for ; Tue, 12 Mar 1996 06:29:48 +0100 Received: from simon.cs.cornell.edu (SIMON.CS.CORNELL.EDU [128.84.154.10]) by concorde.inria.fr (8.7.1/8.7.1) with SMTP id GAA22308 for ; Tue, 12 Mar 1996 06:29:53 +0100 (MET) Received: from cloyd.cs.cornell.edu (CLOYD.CS.CORNELL.EDU [128.84.227.15]) by simon.cs.cornell.edu (8.6.10/R1.4) with ESMTP id AAA21105 for ; Tue, 12 Mar 1996 00:29:46 -0500 Received: from verdandi.cs.cornell.edu (VERDANDI.CS.CORNELL.EDU [128.84.254.202]) by cloyd.cs.cornell.edu (8.6.10/M1.8) with ESMTP id AAA02586; Tue, 12 Mar 1996 00:29:44 -0500 Received: (hayden@localhost) by verdandi.cs.cornell.edu (8.6.10/C1.3) id AAA02769; Tue, 12 Mar 1996 00:29:41 -0500 Date: Tue, 12 Mar 1996 00:29:41 -0500 Message-Id: <199603120529.AAA02769@verdandi.cs.cornell.edu> From: Mark Hayden To: caml-list@pauillac.inria.fr cc: hayden@cs.cornell.edu Subject: Caml Light performance tests? Sender: weis 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?)