ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 12 Jul 2018 14:15:05 +0200computation timehttps://ask.sagemath.org/question/42938/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.
2. 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? Thu, 12 Jul 2018 06:17:29 +0200https://ask.sagemath.org/question/42938/computation-time/Comment by Iguananaut for <p>why the computation time required in the following way of execution is different.</p>
<p>1.to run the algorithm I am writing the code /algorithm directly on the sage terminal window and execute the code.</p>
<ol>
<li>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? </li>
</ol>
https://ask.sagemath.org/question/42938/computation-time/?comment=42956#post-id-42956Most 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.Thu, 12 Jul 2018 14:15:05 +0200https://ask.sagemath.org/question/42938/computation-time/?comment=42956#post-id-42956Comment by slelievre for <p>why the computation time required in the following way of execution is different.</p>
<p>1.to run the algorithm I am writing the code /algorithm directly on the sage terminal window and execute the code.</p>
<ol>
<li>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? </li>
</ol>
https://ask.sagemath.org/question/42938/computation-time/?comment=42941#post-id-42941Please provide actual code and timings, so that other users can reproduce and work on the question.Thu, 12 Jul 2018 11:37:13 +0200https://ask.sagemath.org/question/42938/computation-time/?comment=42941#post-id-42941