From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 049B4BC37 for ; Sun, 10 Jan 2010 20:00:11 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApQBAPeySUvUnwdji2dsb2JhbACDXpgAAQEBCgsKBxEGqjyLPYErgi5WBA X-IronPort-AV: E=Sophos;i="4.49,251,1262559600"; d="scan'208";a="41376210" Received: from relay.pcl-ipout01.plus.net ([212.159.7.99]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 Jan 2010 19:59:49 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALuySUvUnw4R/2dsb2JhbACDXsJ9iz2BK4IuVgQ Received: from pih-relay04.plus.net ([212.159.14.17]) by relay.pcl-ipout01.plus.net with ESMTP; 10 Jan 2010 18:59:48 +0000 Received: from [87.115.174.155] (helo=leper.local) by pih-relay04.plus.net with esmtp (Exim) id 1NU30t-0001FQ-NL; Sun, 10 Jan 2010 18:59:47 +0000 From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Re: HLVM ray tracer performance Date: Sun, 10 Jan 2010 20:14:29 +0000 User-Agent: KMail/1.9.9 References: <20100110132942.1995706rwh00q1zq@mail.msu.edu> In-Reply-To: <20100110132942.1995706rwh00q1zq@mail.msu.edu> Cc: shawjef3@msu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <201001102014.29726.jon@ffconsultancy.com> X-Plusnet-Relay: 01132796fa71bee4017451585a92a9eb X-Spam: no; 0.00; haskell:01 haskell:01 --version:01 compilation:01 --version:01 ocamlopt:01 native-code:01 compiler:01 usr:01 lib:01 ocaml:01 ocaml:01 userland:01 afaict:01 ubuntu:98 On Sunday 10 January 2010 18:29:42 shawjef3@msu.edu wrote: > Jon, > > I=C2=A0wanted to run the raytracing benchmark myself to see if Haskell re= ally > was that slow. I'm using ghc 6.10 because that's what ubuntu comes with. > I=C2=A0don't know if ghc 6.12 generates slower executables than 6.10 or w= hat > else might be going on. I used GHC 6.12 with --make -O2 to get the results from the recent article= =20 because it generated results faster than GHC 6.10. However, I failed to=20 detect that only the Haskell was generating garbage output. Rerunning the=20 benchmark with GHC 6.10 here, Haskell does give the correct answer but the= =20 times are even worse than those I quoted. > I=C2=A0ran each several times and the numbers I=C2=A0pasted=20 > are typical (+/- 0.2 seconds, say). > > jeff@ubuntu:~/Desktop$ ghc --version > The Glorious Glasgow Haskell Compilation System, version 6.10.4 > jeff@ubuntu:~/Desktop$ g++ --version > g++ (Ubuntu 4.4.1-4ubuntu8) 4.4.1 > Copyright (C) 2009 Free Software Foundation, Inc. > This is free software; see the source for copying conditions.=C2=A0 There= is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOS= E. > jeff@ubuntu:~/Desktop$ ocamlopt -v > The Objective Caml native-code compiler, version 3.11.1 > Standard library directory: /usr/lib/ocaml I used g++ 4.3.3 and OCaml 3.11.1 on a 64-bit Linux kernel running 32-bit=20 userland. The machine is an 8-core with two Quad-Core AMD Opteron(tm) 2352= =20 Processors running at 2.1GHz. AFAICT they have 512kb L2 caches each and 2Mb= =20 L3 caches per quadcore CPU. > I=C2=A0compiled the raytracers for c++, haskell and ocaml from > > http://www.ffconsultancy.com/languages/ray_tracer/code/5 > > and used the compile instructions at > > http://www.ffconsultancy.com/languages/ray_tracer/benchmark.html > > though I=C2=A0had to change the haskell one to use just ghc instead of > specifying a version. I=C2=A0also ran the ocaml and haskell code in the 1/ > directory, and they completed within 0.1 seconds of each other. > > c++ > jeff@ubuntu:~/Desktop$ time ./ray 9 512 > /dev/null > > real=C2=A0=C2=A0=C2=A0 0m3.515s > user=C2=A0=C2=A0=C2=A0 0m3.440s > sys=C2=A0=C2=A0=C2=A0 0m0.016s > > haskell > jeff@ubuntu:~/Desktop$ time ./ray 9 512 > /dev/null > > real=C2=A0=C2=A0=C2=A0 0m5.811s > user=C2=A0=C2=A0=C2=A0 0m5.752s > sys=C2=A0=C2=A0=C2=A0 0m0.032s > > ocaml > jeff@ubuntu:~/Desktop$ time ./ray 9 512 > /dev/null > > real=C2=A0=C2=A0=C2=A0 0m6.572s > user=C2=A0=C2=A0=C2=A0 0m6.544s > sys=C2=A0=C2=A0=C2=A0 0m0.016s Are you running x64 or on Intel hardware? What results do you get for 12, 1= 3=20 or 14 instead of 9? =2D-=20 Dr Jon Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/?e