Hi All,

I have an algorithm on the server. I want the algortihm to perform calculations based upon the data which is stored from a database to nested lists before the algorithm is run.

Is there anyway of keeping the program running without any need of retrieving the data from the database to the nested list again and again.
For example if i want the algorithm to run at two different times, is it possible to run the algorithm without actually loading the data both time from the database in the nested list. I just want the data to be retrieved only once from the database and used whenever and no matter how many times needed...

This is because the data is have is very large and retrieving it from the database takes considerable time.

Anyone has any ideas?

10 Years
Discussion Span
Last Post by rockzZ25

Usually memory is saved by keeping data in files. In your case, you would have to keep data in memory using module StringIO. That is swimming upstream.

You could compress your datafile with methods in module zipfile or better tarfile. That will speed up loading time.


Thanks for the reply bumsfeld. I will explain the scenario a bit further to clarify what i actually want to do. the algortihm is to be initiated whenever new postion (GPS coordinates) of the user are sent from the mobile set to another database. The program would check for these coordinates and perform the algorithimic calculations.

As the position of the user holding the mobile can change, therefore say after 30 seconds new GPS coordaintes are sent to the database. Now the program should check if new GPS coordinates have been recioeved and then perform the calculations again.

In this way i want to keep the server running and continously checking for updated GPS coordinates.
If new GPS coordinates are detected, it should perform the algorithmic calculations.

Any ideas...and if using String I/0 module...is only way...can you provide an example.


This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.