On Thu, Apr 10, 2014 at 11:58:30AM -0400, Gabriele Brambilla wrote:
> Hi,
> 
> I have a program that is reading near 600000 elements from a file.
> For each element it performs 200 times a particular mathematical operation
> (a numerical interpolation of a function).
> Now these process takes near 8 hours.

Why are you repeating each operation 200 times? Surely you don't mean 
something like this?

for element in elements_from_file():
    for i in range(200):
        result = function(element)

Before spending your time re-writing the function in C, it may help 
checking that there are no inefficencies in the code. Calculating the 
function may not be what is slowing your code down.

It might help if you show us your code.


-- 
Steven
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to