Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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