From maintainers-request at octave dot org Sun Jan 30 02:07:44 2005 Subject: Re: min function very slow? From: "John W. Eaton" To: "Dmitri A. Sergatskov" Cc: Daniel J Sebald , maintainers@octave.org Date: Sun, 30 Jan 2005 02:06:22 -0600 On 30-Jan-2005, Dmitri A. Sergatskov wrote: | Though ignore_function_time_stamp = "all", I still get mintime consistently | longer then maxtime: | | octave:2> [looptime,maxtime,mintime]=mmt(10000) | looptime = 0.046946 | maxtime = 0.19471 | mintime = 0.22528 | octave:3> [looptime,maxtime,mintime]=mmt(10000) | looptime = 0.040380 | maxtime = 0.18160 | mintime = 22.642 | octave:4> ignore_function_time_stamp = "all" | ignore_function_time_stamp = all | octave:5> [looptime,maxtime,mintime]=mmt(10000) | looptime = 0.040041 | maxtime = 0.17199 | mintime = 0.21179 | ... | octave:8> [looptime,maxtime,mintime]=mmt(30000) | looptime = 0.10826 | maxtime = 0.51337 | mintime = 0.61531 | octave:9> [looptime,maxtime,mintime]=mmt(300000) | looptime = 0.97805 | maxtime = 5.1094 | mintime = 6.0628 With ignore_fucntion_time_stamp = "all", you tell it to not check to see if the function is out of date. But there could still be some significant overhead to look it up the first time. It is odd that searching for a function would take more time when it can be found in a shared library that is already loaded, but that seems to be what is happening. In any case, I don't think this has anything to do with min or max since you can get similar results with other functions that are defined from the same .oct file. Also, try switching the order of the calls to min and max in your script and run it again in a freshly started Octave session and you should see that the second function loaded is the slower one. jwe