From: Issac Trotts <ijtrotts@ucdavis.edu>
To: OCaml List <caml-list@inria.fr>
Subject: [Caml-list] DFT in OCaml vs. C
Date: Wed, 26 Mar 2003 23:33:52 -0800 [thread overview]
Message-ID: <3E82A960.2070707@ucdavis.edu> (raw)
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
next reply other threads:[~2003-03-27 8:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-27 7:33 Issac Trotts [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3E82A960.2070707@ucdavis.edu \
--to=ijtrotts@ucdavis.edu \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox