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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 69EE0BC69 for ; Wed, 11 Apr 2007 00:17:22 +0200 (CEST) Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l3AMHIxi015288 for ; Wed, 11 Apr 2007 00:17:21 +0200 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by mga03.intel.com with ESMTP; 10 Apr 2007 15:15:17 -0700 Received: from orsmsx334.jf.intel.com ([10.22.226.45]) by azsmga001.ch.intel.com with ESMTP; 10 Apr 2007 15:15:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: i="4.14,392,1170662400"; d="scan'208"; a="211300521:sNHT22318359" Received: from orsmsx344.amr.corp.intel.com ([192.168.65.24]) by orsmsx334.jf.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 10 Apr 2007 15:15:14 -0700 Received: from [10.10.35.173] ([10.10.35.173]) by orsmsx344.amr.corp.intel.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 10 Apr 2007 15:15:14 -0700 Message-ID: <461C0C71.7060709@intel.com> Date: Tue, 10 Apr 2007 15:15:13 -0700 From: Jim Grundy User-Agent: Mail/News 1.5.0.2 (X11/20060508) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Functor Performace Question Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 10 Apr 2007 22:15:14.0935 (UTC) FILETIME=[B6CE3070:01C77BBD] X-Miltered: at discorde with ID 461C0CEF.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; functor:01 functor:01 solver:01 sig:01 nat:01 sig:01 elt:01 nat:01 elt:01 struct:01 compiler:01 int:01 int:01 modules:02 types:03 I have a functor related performance issue. I have the following collection of modules and types that we are using in the implementation of a SAT solver: module type Map = sig .. end module Nat_map: Map with type key = int module type PriorityQueue = sig .. end module Make_priority_queue: functor (M : Map) -> PriorityQueue with type elt = M.key module Nat_priority_queue: PriorityQueue with type elt = int If we implement Nat_priority_queue in the "right" way as module Nat_priority_queue = Make_priority_queue (Nat_map) Then I pay about a 3% performance penalty over instantiating the functor by hand... module Nat_priority_queue = struct module M = Nat_map (* same code as the body of Make_priority_queue *) end Is there some compiler switch or future version in the works that will save me from this? Thanks 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