From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA23548; Tue, 28 Sep 2004 19:54:26 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA14980 for ; Tue, 28 Sep 2004 19:54:25 +0200 (MET DST) Received: from ptb-relay02.plus.net (ptb-relay02.plus.net [212.159.14.213]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id i8SHsOa7003560 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 28 Sep 2004 19:54:25 +0200 Received: from [80.229.56.224] (helo=chetara) by ptb-relay02.plus.net with esmtp (Exim) id 1CCMBE-0007Ug-LB for caml-list@inria.fr; Tue, 28 Sep 2004 17:54:24 +0000 From: Jon Harrop To: caml-list@inria.fr Subject: Re: [Caml-list] Caml monomorphisation (was Observations on OCaml vs. Haskell) Date: Tue, 28 Sep 2004 18:50:19 +0100 User-Agent: KMail/1.6.2 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200409281850.19855.jon@jdh30.plus.com> X-Miltered: at nez-perce with ID 4159A551.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 observations:01 haskell:01 2004:99 pons:01 inlining:01 run-time:01 notoriously:01 heuristics:01 inlining:01 optimiser:01 compiler:01 fernandez:01 ocaml:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tuesday 28 September 2004 11:10, Diego Olivier Fernandez Pons wrote: > Why doesn't Caml compiler specialize the type of [max]? OCaml tends to side with concise code. So it doesn't like inlining and type specializing, preferring heavy factoring and run-time dispatch instead. Analysing the productivity of these trade-offs is notoriously tricky because there are lots of interdependent variables. So the heuristics for inlining and type specialization are suspiciously subjective. Hence, the current approach is just being cautious. I've considered writing a whole program optimiser to do things like type specialization and inlining but in most cases it wouldn't buy you much. It some it could buy you a few times better performance though... Cheers, Jon. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners