octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: min function very slow?


From: Daniel J Sebald
Subject: Re: min function very slow?
Date: Sun, 30 Jan 2005 01:13:46 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041020

Dmitri A. Sergatskov wrote:

Daniel J Sebald wrote:

Dmitri A. Sergatskov wrote:

Daniel J Sebald wrote:



Thank you... so do you think your increase for mintime is a blip in the OS? Yours is a factor of 4.5 difference, mine is a factor of 76.


I do not understand this at all. More over on my other computer (AthlonXP 1666 MHz)
the mintime is 2 seconds... The same OS etc...




So I'm not dreaming.  :-)

I put a script in my path to redefine min(x) as -max(-x). That gets me down to the numbers your quoting. I'll see if I can run a profiler on this. I don't think it is in dNDArray.cc where it is spending its time.


I rewrote your script as a function (attached). Here is some numbers:

octave:1> [loopt,mint,maxt]=mmt(10000)
loopt = 0.040803
mint = 0.19301
maxt = 0.22110
octave:2> [loopt,mint,maxt]=mmt(10000)
loopt = 0.031585
mint = 0.18326
maxt = 23.859
octave:3> [loopt,mint,maxt]=mmt(10000)
loopt = 0.039405
mint = 0.18089
maxt = 22.695

On SMP computer (octave compiled with -lpthread, otherwise the same flags):

octave:1> [loopt,mint,maxt]=mmt(10000)
loopt = 0.033668
mint = 0.15524
maxt = 0.18152
octave:2> [loopt,mint,maxt]=mmt(10000)
loopt = 0.026402
mint = 0.14753
maxt = 2.6565

As you can see the first time it runs it gets reasonable numbers, after that it goes nuts.


Sure 'nough. (You've switched maxt and mint, but point taken.) Look at what I'm getting:

octave:1> [loopt, maxt, mint] = mmt(10000)
loopt = 0.10684
maxt = 0.50235
mint = 0.51636
octave:2> [loopt, maxt, mint] = mmt(10000)
loopt = 0.087893
maxt = 0.47367
mint = 71.194

Everything in the code looks so symmetric with regard to min and max. Strange.

Could a header file definition of "min" be substituting code that somehow still compiles? (Wild, wild guess.)

Dan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]