Microbenchmark: Summing over array of doubles

Yaroslav Bulatov bulatov at engr.orst.edu
Sun Aug 1 00:49:00 EDT 2004


I made an array of 10 million floats timed how long it takes to sum
the elements, here's what I got (millis):

gcc -O2:               21
Python with numarray:  104
Python with Numeric:   302
java:                  325 
gcc:                   348
Python with Psyco:     1317
Pure Python using sum: 2312
Pure Python:           5631

http://yaroslav.hopto.org/russianwiki/index.php/c-numeric-speed

numarray takes over Numeric at about 1100 floats

I'm doing intensive computation on arrays in Python, so if you have
suggestions on Python/C solutions that could push the envelope, please
let me know.

Yaroslav



More information about the Python-list mailing list