Take a look at my code - personally I dont know a faster way of doing it (programatically at least). 2 seconds is adequate for me anyway, compared to my slower processor in the past.
Storing data at midnight is one way of doing it - statistics may tell you a best time of the day to take snapshots of planets