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 05:54:48 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Firefox/60.0

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

Just out of interest: does anybody have an idea why there is this speed-up of
a factor 4 even for large prime inputs q? As I see it, in this case both the
old and the new code compute the list of primes up to sqrt(q) and then test
which of those divides q (in a vectorized statement). None does, so it returns
with the answer that q is prime. And here the call to primes() should take
most of the effort, but this code was not altered.

In any case, a minimum increase of a factor 4 for all large inputs is also
very noteworthy.

    _______________________________________________________

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]