Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] DFT in OCaml vs. C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Issac Trotts <ijtrotts@u...>
Subject: [Caml-list] DFT in OCaml vs. C
Here's a numerical mini-benchmark comparing C to OCaml
on a simple implementation of the Discrete Fourier Transform:

  http://redwood.ucdavis.edu/~issac/dft_compare.tar.gz

The results on my 1 GHZ Pentium III Linux box:

C:
real    0m21.273s
user    0m21.200s
sys     0m0.040s

OCaml:
real    1m51.602s
user    1m47.020s
sys     0m0.260s

So the C version was about five times as fast.  This is after looking 
for ideas
in the "Writing Efficient Numerical code in Objective Caml" page [1]
and the Great Language Shootout statistical moment page for OCaml [2].  

The OCaml code was easier to read and debug, and would be
easier to modify.  

I'd be interested if anyone on this list knows of a way
to make it perform as well as the C version (without using the FFT.)

[1] 
http://216.239.53.100/search?q=cache:5YnsSStlWiAC:caml.inria.fr/ocaml/numerical.html+efficient+numerical+ocaml&hl=en&ie=UTF-8

[2]
http://www.bagley.org/~doug/shootout/bench/moments/moments.ocaml

Issac Trotts







-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners