Microbenchmark: Summing over array of doubles

Duncan Booth me at privacy.net
Sun Aug 1 16:53:07 CEST 2004


bulatov at engr.orst.edu (Yaroslav Bulatov) wrote in 
news:4d642979.0407312049.7a8aecab at posting.google.com:

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

I just had a brief look at the code you posted. Are you not concerned about 
accuracy in any of your calculations? Summing a 10 million element array by 
simply accumulating each element into a running total is guaranteed to give 
a lousy result.

Also, without running it I don't see how most of your Python examples work 
since you seem to call the timing function with the result of the 
calculation which doesn't make sense.




More information about the Python-list mailing list