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

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

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


From: Rik
Subject: [Octave-bug-tracker] [bug #51403] isequal is slow
Date: Sun, 26 Nov 2017 00:56:59 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0

Update of bug #51403 (project octave):

                  Status:                    None => In Progress            

    _______________________________________________________

Follow-up Comment #7:

I was wrong.  It turns out it was assert.m that Dan and I optimized. isequal()
was definitely not optimal.  I rewrote it most of the function in this cset
(http://hg.savannah.gnu.org/hgweb/octave/rev/606f3866cdb7).  On average it is
now twice as fast.

Some sample timings:


NUMERIC

x = pi;
tic; for i=1:1e4, isequal (x,x); end; toc
OLD: 2.91767 seconds
NEW: 1.27365 seconds
%change : -56%

x = rand (15,15);
tic; for i=1:1e4, isequal (x,x); end; toc
OLD: 3.08964 seconds
NEW: 1.35772 seconds
%change : -56%



STRING

x = "Hello World";
tic; for i=1:1e4, isequal (x,x); end; toc
OLD: 2.90298 seconds
NEW: 1.17137 seconds
%change: -60%

x = char ("Hello World", "String2", "String3");
tic; for i=1:1e4, isequal (x,x); end; toc
OLD: 2.79572 seconds
NEW: 1.17914 seconds
%change: -58%



CELLSTR

x = { ["ab"; "cd"] ; ["ef"; "gh"] }
tic; for i=1:1e4, isequal (x,x); end; toc
OLD: 2.65822 seconds
NEW: 1.53199 seconds
%change: -42%


The other classes don't improve much because they depend on recursion.



    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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