SterlingYM / astroPIPS

A set of tools for photometric analysis. Determines the period of short-period variable stars.
https://pips.readthedocs.io/en/latest/
MIT License
7 stars 0 forks source link

compiling Numba before first run #18

Open SterlingYM opened 3 years ago

SterlingYM commented 3 years ago

Numba @njit slows down the code for the first run, probably due to the compilation time. Is there any way to compile when PIPS is imported?

arjunsavel commented 3 years ago

This makes sense! I'd only @njit functions that are called many times, in general — such as model evaluation functions in a curve-fitting routine. Or things that are called in loops!

There are some fancy compilation-saving routines that are possible — such as ahead-of-time compilation, I believe.

I can take a peek at the dev branch tomorrow!

SterlingYM commented 3 years ago

So far my plan is to use @njit only on the very core functions that are called many times, such as fourier() or gaussian(). I've looked at AOT but it seems too much for this issue. Probably we can quietly run such functions once PIPS is imported?