caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* 32- and 64-bit performance
@ 2005-03-30  2:40 Jon Harrop
  2005-03-30  7:46 ` [Caml-list] " Alex Baretta
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Jon Harrop @ 2005-03-30  2:40 UTC (permalink / raw)
  To: caml-list


I just bought a new Athlon 64 laptop and installed 32- and 64-bit Debian.
Here are some timings, showing the performance change when moving from 32-
to 64-bit using ocamlopt (3.08.2) and g++ (3.4.4):

Sieve primes up to 10^8 (bit-twiddling/array limited):

32-bit OCaml: 7.102s
64-bit OCaml: 5.697s
Ratio: 1.25

32-bit C++: 19.145s
64-bit C++: 13.433s
Ratio: 1.43

100th-nearest neighbours from a 10k-atom model of amorphous silicon
(de/allocation limited):

32-bit OCaml: 28.407s
64-bit OCaml: 35.538s
Ratio: 0.80

32-bit C++: 14.035s
64-bit C++: 12.392s
Ratio: 1.13

Generate, bubble sort and accumulate an array of 10^4 double-precision
random floating-point numbers:

32-bit OCaml: 1.185s
64-bit OCaml: 0.785s
Ratio: 1.51

32-bit C++: 1.471s
64-bit C++: 0.957s
Ratio: 1.54

without bounds checking:

32-bit OCaml: 0.992s
64-bit OCaml: 0.591s
Ratio: 1.68

32-bit C++: 1.249s
64-bit C++: 0.705s
Ratio: 1.77

2048^2 mandelbrot (float-arithmetic limited):

32-bit OCaml: 2.946s
64-bit OCaml: 1.704s
Ratio: 1.73

32-bit C++: 1.479s
64-bit C++: 1.161s
Ratio: 1.27

1024 FFTs and iFFTs (float-arithmetic limited):

32-bit OCaml: 31.491s
64-bit OCaml: 9.260s
Ratio: 3.40

32-bit C++: 8.441s
64-bit C++: 8.562s
Ratio: 0.99

Accumulate a Lorentzian over the number of integer triples (i, j, k) which
lie in i^2 + j^2 + k^2 < 400 (float-arithmetic limited):

32-bit OCaml: 16.329s
64-bit OCaml: 9.459s
Ratio: 1.73

32-bit C++: 8.002s
64-bit C++: 5.933s
Ratio: 1.35

So ocamlopt does seem to generate significantly better code in these examples, 
particularly when they are floating point intensive. Also, only one test is 
slower in 64-bit, due to its heavy use of trees.

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists


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

end of thread, other threads:[~2005-04-03 10:01 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-30  2:40 32- and 64-bit performance Jon Harrop
2005-03-30  7:46 ` [Caml-list] " Alex Baretta
2005-03-30  8:00   ` Ville-Pertti Keinonen
2005-03-30  8:41     ` Alex Baretta
2005-03-30  9:01       ` Ville-Pertti Keinonen
2005-03-30 12:53         ` Jon Harrop
2005-03-30 14:34           ` Ville-Pertti Keinonen
2005-03-30  8:10   ` Robert Roessler
2005-03-30  8:11   ` Alexander S. Usov
2005-03-30 13:46 ` Eijiro Sumii
2005-03-31 13:42   ` Jon Harrop
2005-03-31 15:05 ` Stefan Monnier
2005-03-31 18:40   ` [Caml-list] " Jon Harrop
2005-03-31 22:41     ` Richard Jones
2005-04-02 20:23     ` Stefan Monnier
2005-04-02 20:50       ` [Caml-list] " David Brown
2005-04-03 10:01         ` Ville-Pertti Keinonen

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).