Execution speed of simple matrix operations in various languages

Note from April, 2007: The benchmark code used here will be changed soon as a result of completing an implementation in Haskell. The Haskell implementation ran 20 times faster than the C++ with ublas implementation! Haskell had factored out the matrix-vector multiplication from the iteration. No other language had done this. The benchmark will be changed to prevent this. So, while the Haskell execution performance may be slower than C, the ghc Haskell compiler is pretty good at optimizing the code!

Computer C++ C++, 1/4 loops C++ with ublas/acml Matlab Octave Python R Haskell with GSL Ocaml Ocaml, 1/4 loops Ocaml, 1/10 loops Ocaml inner recursive Ocaml all recursive
HP tc4400: Intel Core 2 Duo, 2 GHz, 667-MHz FSB, 4-MB L2 cache, 2 GB RAM 3.2 2.0 1.98 1.79 6.17   9.3 6.5 10.4 5.5 5.1 16.3 16.3
HP xw9300: Dual Opteron 254, 2.8 Ghz, 4 GB RAM 3.4 1.95 2.17 1.95   3.5 5.7            
Dual Opteron 248HE, 2GB 4.3 2.5 2.62 2.5 4.25   7.3   5.0 2.4 2.1 12.9 12.8
Dual Intel Xeon           4.1              
Apple Laptop PowerPC G4, 1.33 GHz 8.1 4.4       6.3 65.7   15.7 11 8.2 39.5 40.0
P4, 3.2 GHz, 2 GB 3.3     1.7   5 19.6   17.4 6.3 5.2 18.3 18.4
1.8GHz Athlon 64 4.7               6.2 3.0      
1.2GHz Athlon T-bird 7.6               23.0 10.6      

Code

Matlab bench

Running Matlab's bench function on the HP xw9300, dual Opteron 254, 2.8 Ghz, 4GB RAM, Nvidia Quadro FX 3450/4000 (as "this machine" below) resulted in

LU FFT ODE Sparse 2-D 3-D
This machine 0.1998 0.3008 0.1166 0.3918 0.3656 0.4054
AMD Opteron, 2.1 GHz Dual 0.2741 0.4028 0.1377 0.5027 0.3648 0.4479
Intel Pentium 4, 3.0 GHz 0.2380 0.4555 0.2398 0.4806 0.6052 0.4303
Intel Pentium 4, 2.0 GHz 0.3850 0.8116 0.3301 0.7551 0.7072 0.6810
Macintosh G5, 2.0 GHz Dual 0.2926 0.4927 0.3039 0.4873 1.8034 0.9763
AMD Athlon, 2.0 GHz Dual 0.5898 0.7984 0.3509 0.7776 1.3207 0.9591
Macintosh G4, 1.25 GHz Dual 0.6256 0.9347 0.4480 1.1388 2.1687 1.1579
Sun UltraSPARC-III 1.2 GHz Dual 0.6495 0.6324 0.6847 1.4580 1.3532 3.1783
HP-UX, 875MHz Dual 0.4555 1.7123 0.7610 1.2496 1.5423 2.8734