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=none 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 ACA17BC0B for ; Sat, 9 Dec 2006 00:13:44 +0100 (CET) Received: from azsmga101.ch.intel.com (mga07.intel.com [143.182.124.22]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id kB8NDgJR008161 for ; Sat, 9 Dec 2006 00:13:43 +0100 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 08 Dec 2006 15:13:41 -0800 Received: from orsmsx335.jf.intel.com ([10.22.226.40]) by azsmga001.ch.intel.com with ESMTP; 08 Dec 2006 15:13:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: i="4.09,515,1157353200"; d="scan'208"; a="155827911:sNHT24490270" Received: from orsmsx344.amr.corp.intel.com ([192.168.65.24]) by orsmsx335.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 8 Dec 2006 15:13:40 -0800 Received: from [10.10.35.173] ([10.10.35.173]) by orsmsx344.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 8 Dec 2006 15:13:40 -0800 Message-ID: <4579F1A4.6080606@ichips.intel.com> Date: Fri, 08 Dec 2006 15:13:40 -0800 From: Jim Grundy User-Agent: Mail/News 1.5.0.2 (X11/20060508) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: A Question About Types and Inlining Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 08 Dec 2006 23:13:40.0601 (UTC) FILETIME=[7F891E90:01C71B1E] X-Miltered: at concorde with ID 4579F1A6.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; inlining:01 solver:01 ocaml:01 solver:01 literals:01 uncomment:01 compiler:01 compilation:01 ocamlopt:01 signatures:01 ints:01 int:01 int:01 modules:02 modules:02 Apologies in advance for a naive question... I'm working on a SAT solver in OCaml. The solver has various types, like three-valued bools, variables, literals. I have modules that encapsulate these types and the operations on them. Now, as it turns out, all these types are represented as ints, but the other modules that use those types don't need to know that - and as a matter of taste I'd rather not expose this. The signatures of these modules currently contain lines like this: type variable (* = int *) If I uncomment all instances of (* = int *) and reveal the representation to the compiler then I get a ... 36% performance improvement in the SAT solver. I have two questions: 1/ Is there some way I can reveal this representation to the parts of the system that clearly need it for effective optimization, without opening this up for general use. 2/ Failing that, has someone got a pleasant method of doing conditional compilation so that I can switch these comments on and off with ease? I'm using version 3.09.2 of ocamlopt. Thanks in advance Jim -- Jim Grundy, Research Scientist. Intel Corporation, Strategic CAD Labs Mail Stop RA2-451, 2501 NW 229th Ave, Hillsboro, OR 97124-5503, USA Phone: +1 971 214-1709 Fax: +1 971 214-1771 http://www.intel.com/technology/techresearch/people/bios/grundy_j.htm Key Fingerprint: 5F8B 8EEC 9355 839C D777 4D42 404A 492A AEF6 15E2