[bug #68121] convert isequal to built-in function for performance

"Dmitri A. Sergatskov" <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

Follow-up Comment #12, bug #68121 (group octave):

It would be nice to see some benchmarks. I tried some simple one and it runs
slower by about 10 times.
Before:

octave:2> a = randi(250, 1e4, 1e4, "uint8");
octave:3> b = a + uint8(1);
octave:4> c = b - uint8(1);
octave:5> tic; isequal(a, b), toc
ans = 0
Elapsed time is 0.032243 seconds.
octave:6> tic; isequal(a, c), toc
ans = 1
Elapsed time is 0.023694 seconds.

After:

octave:3> a = randi(250, 1e4, 1e4, "uint8");
octave:4> b = a + uint8(1);
octave:5> c = b - uint8(1);
octave:6> tic; isequal(a, b), toc
ans = 0
Elapsed time is 0.218363 seconds.
octave:7> tic; isequal(a, c), toc
ans = 1
Elapsed time is 0.275361 seconds.


Dmitri.
-- 




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68121>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCacwPlgAKCRCqLAuaBUf3
TnzhAQCJJ9e/yWkXzQxexjRPQEAzuvw7qXIgq8xgPjesBu6MHAEA3Fe+xbrpM0kY
oZnKoibGUeCGZFInh5nMRVq3VOM4rQ0=
=4/n3
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.