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
[Caml-list] Num library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-10 (09:42)
From: sebastien FURIC <sebastien.furic@t...>
Subject: Re: [Caml-list] Num library

Alain Frisch a écrit :
> Hello Caml List,
> I'm considering using the Num library (from the standard distribution) for
> implementing numbers in an interpreter. Questions:
> - Is there any benchmark available ?  What is the overhead when dealing
>   with "small" integers ?
> - How does the library compare with other large/rational numbers
>   implementations ?

 I made some benchmarks with Dolphin Smalltalk (a pure Smalltalk
bytecode interpreter) and O'Caml (using ocamlopt) a few months ago. To
my great surprise, Dolphin Samlltalk outperformed O'Caml by a factor of
4 over various tests IIRC. I think the same results may be obtained with
other modern big numbers implementations against O'Caml's one.
 The context was the following: I had to rewrite a program that performs
symbolic manipulations from Smalltalk to O'Caml and this benchmark was
the first thing I did to test O'Caml's performance (I was a little
disappointed!). Finally, despite O'Caml's poor performance over bignum
computations, O'Caml outperformed Smalltalk by a factor of 100 over
"real world" benchmarks! (because only a few percents of the time is
spent in bignum calculations and most of the time is spent doing
substitutions etc.).

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: