December 27th, 2012, 02:46 PM
Python program running slower on a better computer
I have that python program I developed on my mac laptop.
It takes ~25seconds to do one loop, which I repeat many times for an optimization procedure.
Now I'm on a much more powerful mac with 24Gb of Ram, and each loop takes 34seconds...
On both I use the EPD distrubtion: python 2.7.2 32bit.
Any similar experience and advice ?
Thanks a lot !
December 27th, 2012, 02:48 PM
Can you post your code either here or somewhere we can look at it?
Or can you talk about what the program does?
December 27th, 2012, 03:05 PM
Originally Posted by StevenJM
It's a pretty long program so I wont post it, but it is pretty simple too. It has several loops (each day of the year, for each of 5000 locations, etc), which makes it a pretty large number of computation, but these computations are otherwise very simple.
I limited the number of function calls to the strict minimum for improved efficiency, so it mostly does divisions, multiplications and so on: little use of where(), min(), isnan(), etc. I'm using numpy, dont know if that could explain...
Just thinking now I should time a very simple test loop on both computers to see whether it's specific to my program or not, will do !
Thanks a lot !
December 27th, 2012, 10:33 PM
All I can think of is that numpy was compiled with different optimization levels. Unlikely, huh.
[/code] are essential for python code and Makefiles!