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

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

[Octave-bug-tracker] [bug #61129] Performance of factor(). Proposed patc


From: anonymous
Subject: [Octave-bug-tracker] [bug #61129] Performance of factor(). Proposed patch attached.
Date: Wed, 8 Sep 2021 21:01:50 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0

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

Some hours of testing later, the patch is improved. (Improved patch attached).
Please test and check for correctness.

Updated code to test performance with and without patch:


p = uint64 (3999999979) ^ 2; ## large prime^2 near 2^64
pos = 0;
t = [];
for i = -100:+100
  tic
  f = factor (p+i);
  t(++pos) = toc;
  assert (prod(f) == i)  ## check for correctness
  disp([i t(pos)])
end
sum(t)  ## performance metric


Results:

With patch: about 44 minutes.
Without patch: longer than 2 hours.

Please comment if this is an acceptable approach.

(file #51879)
    _______________________________________________________

Additional Item Attachment:

File name: factor.m.patch                 Size:0 KB
    <https://file.savannah.gnu.org/file/factor.m.patch?file_id=51879>



    _______________________________________________________

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]