computation time
why the computation time required in the following way of execution is different.
1.to run the algorithm I am writing the code /algorithm directly on the sage terminal window and execute the code.
- in this process I am creating a .sage file of code/algorithm and save the file in a document. then load/attach that file with the proper path on sage terminal. the execution/ computation time in both the cases is different why?
Please provide actual code and timings, so that other users can reproduce and work on the question.
Most likely, when you were working interactively you already had various modules imported and intermediate results cached, whereas when starting from a new session and loading the code, you don't have the benefit of those cached results. But without specifics it's hard to say. I believe there is work being done towards automatically persisting more cached results to disk, but it's an open question as to exactly what to persist and how, since there is a tradeoff between disk usage and performance. Of course, if you know exactly what intermediate results need to be persisted there are possibilities to do so manually.