On 30/07/2019 17:21, boB Stepp wrote: > musings I am wondering about -- in general -- whether it is best to > store calculated data values in a file and reload these values, or > whether to recalculate such data upon each new run of a program.
It depends on the use case. For example a long running server process may not care about startup delays because it only starts once (or at least very rarely) so either approach would do but saving diskspace may be helpful so calculate the values. On the other hand a data batch processor running once as part of a chain working with high data volumes probably needs to start quickly. In which case do the calculations take longer than reading the extra data? Probably, so store in a file. There are other options too such as calculating the value every time it is used - only useful if the data might change dynamically during the program execution. It all depends on how much data?, how often it is used?, how often would it be calculated? How long does the process run for? etc. -- Alan G Author of the Learn to Program web site http://www.alan-g.me.uk/ http://www.amazon.com/author/alan_gauld Follow my photo-blog on Flickr at: http://www.flickr.com/photos/alangauldphotos _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor