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

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

[Octave-bug-tracker] [bug #50796] calling find on diagonal matrix is slo


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #50796] calling find on diagonal matrix is slower than full matrix
Date: Thu, 13 Apr 2017 09:19:15 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

URL:
  <http://savannah.gnu.org/bugs/?50796>

                 Summary: calling find on diagonal matrix is slower than full
matrix
                 Project: GNU Octave
            Submitted by: carandraug
            Submitted on: Thu 13 Apr 2017 01:19:14 PM UTC
                Category: Performance
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: GNU/Linux

    _______________________________________________________

Details:

I though this was because find converts a diagonal to a full matrix
internally, but even if calling full ourselves before find, it's still much
faster so I am no longer sure:


octave> d = eye (10000);
octave> f = full (eye (10000));
octave> for i=1:10, find (d); endfor, t = cputime (); for i=1:100, find (d);
endfor, cputime () -t
ans =  104.37
octave> for i=1:10, find (f); endfor, t = cputime (); for i=1:100, find (f);
endfor, cputime () -t
ans =  57.920
octave> for i=1:10, find (full (d)); endfor, t = cputime (); for i=1:100, find
(full (d)); endfor, cputime () -t
ans =  58.280





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?50796>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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