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.6 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 7B88EBC0B for ; Sat, 9 Dec 2006 02:16:25 +0100 (CET) Received: from 26.mail-out.ovh.net (26.mail-out.ovh.net [213.186.42.179]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id kB91GPAS006628 for ; Sat, 9 Dec 2006 02:16:25 +0100 Received: (qmail 28129 invoked by uid 503); 9 Dec 2006 01:16:32 -0000 Received: (QMFILT: 1.0); 09 Dec 2006 01:16:32 -0000 Received: from b7.ovh.net (HELO mail157.ha.ovh.net) (213.186.33.57) by 26.mail-out.ovh.net with SMTP; 9 Dec 2006 01:16:32 -0000 Received: from b0.ovh.net (HELO queue-out) (213.186.33.50) by b0.ovh.net with SMTP; 9 Dec 2006 01:16:29 -0000 Received: from vil93-4-82-227-140-227.fbx.proxad.net (HELO ?192.168.1.2?) (lists%philippewang.info@82.227.140.227) by ns0.ovh.net with SMTP; 9 Dec 2006 01:16:26 -0000 Message-ID: <457A0E60.6080204@philippewang.info> Date: Sat, 09 Dec 2006 02:16:16 +0100 From: Philippe Wang User-Agent: Thunderbird 1.5.0.8 (Macintosh/20061025) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] A Question About Types and Inlining References: <4579F1A4.6080606@ichips.intel.com> <20061209005506.GD3642@localhost> In-Reply-To: <20061209005506.GD3642@localhost> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Ovh-Remote: 82.227.140.227 (vil93-4-82-227-140-227.fbx.proxad.net) X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-Miltered: at concorde with ID 457A0E69.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; inlining:01 unboxing:01 ocamlopt:01 -inline:01 compiler:01 optimise:01 cheers:01 signatures:01 typing:01 caml-list:01 int:01 int:01 newline:02 newline:02 match:02 Eric Cooper a écrit : > You can use > type variable = Variable of int > etc. > in your signatures. > > This makes the representation visible for optimization purposes, > incurs no representation overhead, but will catch most typing > mistakes. I don't get it... Can you tell how adding some boxing/unboxing matter can help having better performance ? I tried this with ocamlopt -inline 4 type v = V of int let v = V 42 ;; let _ = match v with V x -> print_int x ;; print_newline();; let _ = print_int (Obj.magic v);; print_newline();; let _ = print_int (!(Obj.magic v));; print_newline();; So whether the Obj.magic "tells" the compiler not to optimise the values of type v, whether I really don't get what you meant... Cheers, -- Philippe Wang