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.2 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 9A8D9BC69 for ; Thu, 31 May 2007 17:16:29 +0200 (CEST) Received: from smtp5-g19.free.fr (smtp5-g19.free.fr [212.27.42.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4VFGTFt016399 for ; Thu, 31 May 2007 17:16:29 +0200 Received: from Tocksi.local (lns-bzn-60-82-254-250-10.adsl.proxad.net [82.254.250.10]) by smtp5-g19.free.fr (Postfix) with ESMTP id 1C99244FED for ; Thu, 31 May 2007 17:16:29 +0200 (CEST) Message-ID: <465EE6CB.5050506@univ-savoie.fr> Date: Thu, 31 May 2007 17:16:27 +0200 From: Christophe Raffalli User-Agent: Thunderbird 2.0.0.0 (Macintosh/20070326) MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Comparison of OCaml and MLton for numerics References: <5195a210705302250u6a9e5adey4ed857480f9e5cd8@mail.gmail.com> In-Reply-To: <5195a210705302250u6a9e5adey4ed857480f9e5cd8@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Miltered: at concorde with ID 465EE6CD.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; christophe:01 raffalli:01 christophe:01 raffalli:01 univ-savoie:01 ocaml:01 ocaml:01 unboxed:01 arrays:01 unboxed:01 reasonnable:01 caml-list:01 tuples:01 tuple:02 tuple:02 Yuanchen Zhu a écrit : > > let (kx, ky) = kern.(i) in You should avoid array of tuples of float in OCaml, tuple of float are (unfortunatly) not unboxed and array of tuple neither, so you have two inderection (boxes) inside the array. Either use array of records (you will have one box), one array of double size or two separate arrays (no boxing at all). The difference should be quite big (it would be interesting if you post the result). One of the point of MLTon (if I remember well) is to always unbox floats ... While in OCaml, you have to be carefull. I really would like an "unboxed array" type in OCaml rather than a special optimisation for floats. Then, the solution with an unboxed array of records would be reasonnable. Christophe Raffalli