English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Comparison of OCaml and MLton for numerics
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-31 (15:16)
From: Christophe Raffalli <Christophe.Raffalli@u...>
Subject: Re: [Caml-list] Comparison of OCaml and MLton for numerics
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