#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0

    Python program running slower on a better computer


    Hi all,

    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 !
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    12
    Rep Power
    0
    Can you post your code either here or somewhere we can look at it?

    Or can you talk about what the program does?
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    2
    Rep Power
    0
    Originally Posted by StevenJM
    Can you post your code either here or somewhere we can look at it?

    Or can you talk about what the program does?
    Hi, thanks.

    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 !
  6. #4
  7. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,900
    Rep Power
    481
    All I can think of is that numpy was compiled with different optimization levels. Unlikely, huh.
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo