Microbenchmark: Summing over array of doubles

Yaroslav Bulatov bulatov at engr.orst.edu
Sun Aug 1 06:49:00 CEST 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


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.


More information about the Python-list mailing list