ijiraq/MOP — pull request #90 by drusk (2013-07-09 22:06:42+00:00)
Title: Optimize startup

Moved import statements that result in iraf/astropy getting loaded into the methods where they are used. It is generally bad style to have imports anywhere but the top of the file, but this avoids loading up IRAF when it isn't needed (i.e. processing candidates). I will have to keep an eye out to see if there is an established pattern for handling this kind of lazy loading. I haven't found anything so far; the average module has negligible loading time, and even if it doesn't you will usually need it eventually. However, we have sort of two apps in one, and it isn't needed in one, so it is an unusual situation.

On my development machine, my profiling shows candidates startup time reduced from 4.574 seconds on average to 2.702 seconds on average (about 1.7 times speedup).

This seems to be all I can do for now to speed up start times. Closes #89.