caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] DFT in OCaml vs. C
@ 2003-03-27  7:33 Issac Trotts
  2003-03-27 10:58 ` Fabrice Le Fessant
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Issac Trotts @ 2003-03-27  7:33 UTC (permalink / raw)
  To: OCaml List

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


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2003-03-27 21:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-27  7:33 [Caml-list] DFT in OCaml vs. C Issac Trotts
2003-03-27 10:58 ` Fabrice Le Fessant
2003-03-27 19:40   ` Issac Trotts
2003-03-27 14:21 ` Markus Mottl
2003-03-27 20:47   ` Issac Trotts
2003-03-27 14:32 ` Xavier Leroy
2003-03-27 14:55   ` Falk Hueffner
2003-03-27 16:06   ` OCaml performance (was: Re: [Caml-list] DFT in OCaml vs. C) David Monniaux
2003-03-27 21:27     ` Issac Trotts
2003-03-27 20:54   ` [Caml-list] DFT in OCaml vs. C Issac Trotts

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).