[Tutor] question about run time

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Tue May 2 22:31:59 CEST 2006



> I have been using python for sometime...and occasionally I noticed 
> significant delay before the code would run but unitl now I have been 
> able to write it off to other things.  Now I have a short script that I 
> wrote to check some files and print out a few lines.
>
> I have noticed that usually the first time I fire it up in the morning 
> or after a long time of not running it, it takes 10-15 seconds to run 
> and the output to the screen is very slow...maybe 1 second per line. 
> If I run it soon after that it runs and the output is on the screen in 
> less then a second.  I would think this has to do with compiling but I 
> am not sure.  Any ideas how to speed this up?
>
> I am running python 2.4 on a RHE3.0 cluster.
                                ^^^^^^^^^^^^^^

Hi John,

One thing to check is to see if the program is spending the majority of 
its time doing input and output (I/O Bound), or if it's really doing heavy 
computations (CPU bound).  Knowing this might provide clues as to why 
you're seeing this kind of jerky performance.

Also, you may want to check with your cluster folks on the possible 
effects the cluster's architecture may have on program startup.  You're 
running on a slightly specialized platform, so I wouldn't be surprised if 
the cluster architecture is contributing something special.

Finally, if you want to share that script for people to comment on, that 
might help.


Good luck!


More information about the Tutor mailing list