the amazing performance of C++ code does not surprise me: a tenfold
improvement of the simple Python/Numpy code can be achieved with
weave.inline or Pyrex.

Hence your benchmarks seems to confirm that "weaved" or "pyrexed" code run
as fast as C++ compiled one.

Moreover, from your numbers, I can tell that compiling numpy with gcc or icc
makes no big difference.

Am I correct?

If yes, let me know if I can add this info to the scipy wiki: I'm preparing
an extention to this page http://www.scipy.org/PerformancePython.

cheers,
lorenzo




On 4/17/07, rex <[EMAIL PROTECTED]> wrote:

lorenzo bolla <[EMAIL PROTECTED]> [2007-04-17 00:37]:
> as soon as you do it, I'd like to compare them with the benchmarks I
posted
> here few days ago (compiled with gcc):


http://lbolla.wordpress.com/2007/04/11/numerical-computing-matlab-vs-pythonnumpyweave/

Thanks for the link.

I haven't built numpy with MKL 9.1 yet, but here are some results
running laplace.py using MKL 8.1. The CPU is a Core 2 Duo (currently)
overclocked to 2.94 GHz (it will run at 3.52 GHz).

Using Python2.5 compiled with icc 9.1, numpy built with MKL 8.1
Doing 100 iterations on a 500x500 grid
numeric took 1.53 seconds
slow (100 iterations) took 130.02 seconds
slow with Psyco (100 iterations) took 107.91 seconds

Python compiled with icc takes 85 times longer to run this benchmark
than Python/NumPy does.

Using Python2.5 compiled with gcc, numpy built with MKL 8.1
Doing 100 iterations on a 500x500 grid
numeric took 1.57 seconds
slow (100 iterations) took 154.29 seconds
slow with Psyco (100 iterations) took 119.88 seconds

Python compiled with gcc takes 101 times longer to run this benchmark
than Python/NumPy/icc does.

The C++ version compiled with gcc 4.1.2 runs in .19 seconds.

-rex
--
I liked Occam's razor so much I bought the company.
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to