Running time increment of repeating 'zsolve' in 4ti2

asked 2020-06-26 21:54:57 -0500

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?

edit retag flag offensive close merge delete

Comments

Here is the chart.

https://byeongsuyu.github.io/scr_zsolve.png (https://byeongsuyu.github.io/scr_zsol...)

Byeongsu Yu gravatar imageByeongsu Yu ( 2020-06-26 21:54:34 -0500 )edit