Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
OCaml and C math routines
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-10-13 (19:46)
From: David McClain <dmcclain@a...>
Subject: OCaml and C math routines
OCaml'ers... I would be very interested to hear your response to this!

|> From: -Zhong Shao

||> From: "Stephen T. Weeks" <>
||> ...................
||> Even more impressive for the OCAML compiler is the fact that the
||> PLClub entry was compiled using separate compilation (please
||> correct me if I'm wrong) but the MLton entry was compiled whole
||> program (by necessity) and the SML/NJ entry was compiled whole
||> program (because it improves the speed).

>From what I know, for the floating-point intensive benchmarks, Ocaml
is faster than SML/NJ mainly because Ocaml directly calls the native,
C-based math library (which in turn is fine-tuned for the actual
processor).  SML/NJ, on the other hand, implements all of the math
library functions (e.g., cos, sin, tan) in ML itself (as part of the
SML basis). There is easily an order-of-magnitude difference between
these two implementations. You could try to measure a few such math
functions to find out.

>Members of the SML basis committee and the Ocaml group probably can
tell us the pros and cons of calling the native math library vs. having
it written in ML itself.

- DM