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.Sat, 27 Jun 2020 04:54:34 +0200Running time increment of repeating 'zsolve' in 4ti2https://ask.sagemath.org/question/52233/running-time-increment-of-repeating-zsolve-in-4ti2/I found an interesting phenomenon about zsolve in 4ti2. Here is the sample code.
from sage.interfaces.four_ti_2 import four_ti_2
import time
A = [[1,1,1],[1,2,3]]
rel = ['<', '<']
rhs = [2, 3]
sign = [1,1,1]
for i in range(1000):
start = time.time()
result=four_ti_2.zsolve(A, rel, rhs, sign)
print("Running time for zsolve in 4ti2:", time.time()-start," sec")
I expected that except for the first iteration, which needs time for loading the library at first time on the memory, all iterations should take statistically consistent time with some noise following a normal distribution. However, What I got is a chart showing that running time is increasing linearly, with some noises. You can see the chart on the comment (Due to my insufficient Karma, I cannot make a hyperlink for the chart. You can see it in the comment.)
As you can see from the chart, the running time is increasing while the operation itself still the same. Could anyone explains why this phenomenon happens and how to prevent it to minimize its running time?Sat, 27 Jun 2020 04:54:17 +0200https://ask.sagemath.org/question/52233/running-time-increment-of-repeating-zsolve-in-4ti2/Comment by Byeongsu Yu for <p>I found an interesting phenomenon about zsolve in 4ti2. Here is the sample code.</p>
<pre><code>from sage.interfaces.four_ti_2 import four_ti_2
import time
A = [[1,1,1],[1,2,3]]
rel = ['<', '<']
rhs = [2, 3]
sign = [1,1,1]
for i in range(1000):
start = time.time()
result=four_ti_2.zsolve(A, rel, rhs, sign)
print("Running time for zsolve in 4ti2:", time.time()-start," sec")
</code></pre>
<p>I expected that except for the first iteration, which needs time for loading the library at first time on the memory, all iterations should take statistically consistent time with some noise following a normal distribution. However, What I got is a chart showing that running time is increasing linearly, with some noises. You can see the chart on the comment (Due to my insufficient Karma, I cannot make a hyperlink for the chart. You can see it in the comment.)
As you can see from the chart, the running time is increasing while the operation itself still the same. Could anyone explains why this phenomenon happens and how to prevent it to minimize its running time?</p>
https://ask.sagemath.org/question/52233/running-time-increment-of-repeating-zsolve-in-4ti2/?comment=52234#post-id-52234Here is the chart.
https://byeongsuyu.github.io/scr_zsolve.pngSat, 27 Jun 2020 04:54:34 +0200https://ask.sagemath.org/question/52233/running-time-increment-of-repeating-zsolve-in-4ti2/?comment=52234#post-id-52234