From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1D18ABC0B for ; Thu, 28 Dec 2006 18:00:45 +0100 (CET) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBSH0iKc030978 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 28 Dec 2006 18:00:44 +0100 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1GzycQ-0000Zw-00; Thu, 28 Dec 2006 17:00:38 +0000 Date: Thu, 28 Dec 2006 17:00:38 +0000 To: Ian Oversby Cc: oandrieu@nerim.net, caml-list@yquem.inria.fr Subject: Re: [Caml-list] Question on writing efficient Ocaml. Message-ID: <20061228170037.GA688@furbychan.cocan.org> References: <15946.213.30.139.86.1167315231.squirrel@webmail.nerim.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at concorde with ID 4593F83C.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 unboxing:01 ocaml:01 unboxing:01 ocamlopt:01 28,:98 blog:98 blog:98 wrote:01 caml-list:01 compiles:01 caml:02 caml:02 inefficient:02 inefficient:02 On Thu, Dec 28, 2006 at 04:03:55PM +0000, Ian Oversby wrote: > Does this mean that unboxing is inefficient in OCaml? I've written an > alternative version of the C++ that returns NULL instead of out of bound > values which was close to the same speed so it would be a little > disappointing if I couldn't achieve something similar in OCaml with Some / > None. It's not so much that boxing/unboxing is inefficient in OCaml, but rather that ocamlopt compiles exactly what you ask it to. If you ask it to use a box, it uses a box! (Well, mostly ...) See: http://caml.inria.fr/pub/old_caml_site/ocaml/numerical.html in particular the note about Gallium. Rich. -- Richard Jones, CTO Merjis Ltd. Merjis - web marketing and technology - http://merjis.com Internet Marketing and AdWords courses - http://merjis.com/courses - NEW! Merjis blog - http://blog.merjis.com - NEW!