octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #61129] Improve performance of factor() functi


From: Michael Leitner
Subject: [Octave-bug-tracker] [bug #61129] Improve performance of factor() function
Date: Tue, 5 Oct 2021 13:53:13 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0

Follow-up Comment #20, bug #61129 (project octave):

Sorry, I cannot reproduce that. Using 

++
x = [uint64(230584300921369) * 10000 + 3951];
--

takes 16.2 seconds for the version on the development branch (and exactly the
same for the m-file that comes with octave version 4.0.3, where I am trying
this) and 15.3 seconds for the last version here. This can be split down in
13.5 seconds for computing primes(), about one second for the cast to uint64
that is not necessary but happens in the development version, and 1.9 seconds
for the test whether any prime divides x (I do not see much difference between
mod and rem here). And for the product of three primes, which all are too
large to appear in smallprimes, it is qualitatively the same.

I see that both of you report this factor 4, but I really do not see where
this could come from. Could you try to instrument factor() on your
installations to see where, outside of the call to primes(), so much time is
spent? Or is the cast of the output list, which is the single difference
between primes(sqrt(x)) and primes(uint64(sqrt(x))), so much slower on your
architecture, so that the two calls to primes() differ by a factor of four?

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?61129>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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