From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA27018; Thu, 27 Mar 2003 09:22:08 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA26619 for ; Thu, 27 Mar 2003 09:22:07 +0100 (MET) Received: from marble.he.net (marble.he.net [216.218.230.2]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2R7RqX09054 for ; Thu, 27 Mar 2003 08:27:53 +0100 (MET) Received: from ucdavis.edu ([208.227.214.58] (may be forged)) by marble.he.net (8.8.6/8.8.2) with ESMTP id XAA24608 for ; Wed, 26 Mar 2003 23:27:46 -0800 Message-ID: <3E82A960.2070707@ucdavis.edu> Date: Wed, 26 Mar 2003 23:33:52 -0800 From: Issac Trotts User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020913 Debian/1.1-1 MIME-Version: 1.0 To: OCaml List Subject: [Caml-list] DFT in OCaml vs. C Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; issac:01 trotts:01 ijtrotts:01 fourier:01 redwood:99 0.040:01 shootout:01 bagley:01 moments:99 debug:01 ocaml:01 caml:01 tar:01 ucdavis:02 transform:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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