computation time

asked 2018-07-12 06:17:29 +0200

santoshi gravatar image

why the computation time required in the following way of execution is different. run the algorithm I am writing the code /algorithm directly on the sage terminal window and execute the code.

  1. 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?
edit retag flag offensive close merge delete



Please provide actual code and timings, so that other users can reproduce and work on the question.

slelievre gravatar imageslelievre ( 2018-07-12 11:37:13 +0200 )edit

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.

Iguananaut gravatar imageIguananaut ( 2018-07-12 14:15:05 +0200 )edit