[Top][All Lists]

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

[Octave-bug-tracker] [bug #51403] isequal is slow

From: Guillaume
Subject: [Octave-bug-tracker] [bug #51403] isequal is slow
Date: Thu, 6 Jul 2017 10:45:00 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0


                 Summary: isequal is slow
                 Project: GNU Octave
            Submitted by: gyom
            Submitted on: Thu 06 Jul 2017 02:44:58 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Performance
                  Status: None
             Assigned to: None
         Originator Name: Guillaume
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: dev
        Operating System: Any



I noticed that calls to isequal() were the origin of a performance bottleneck
on a larger piece of code I'm working on, especially as compared to Matlab.

clear A
[A.field1{1:64}] = deal('string');
[A.field2{1:64}] = deal('string');
A.field3 = rand(128,4);
[A.field4{1:64}] = deal('string');
A.field5 = rand(128,4);

In Matlab:

>> tic;for i=1:100, isequal(A,A);end;toc
Elapsed time is 0.007132 seconds.

In Octave:

octave> tic;for i=1:100, isequal(A,A);end;toc
Elapsed time is 7.8635 seconds.

Looking at the code in __isequal__, I'm not sure to understand the code to
compare numeric arrays, especially the use of find(). It doesn't seem to be
the only reason of the slowness though. Does anyone have any suggestion on how
to make this function run faster?


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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