[bug #68121] convert isequal to built-in function for performance
Nicholas Jankowski <[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 #18, bug #68121 (group octave):
oh i wasn't thinking of the trivial cases, but something like:
>> M = randi([1 10],9)-1;
>> tic,for idx = 1:100, M==M;endfor,toc
Elapsed time is 0.000114918 seconds.
>> tic,for idx = 1:10000, all(M(:));endfor,toc
Elapsed time is 0.0353448 seconds.
>> tic,for idx = 1:10000, isequal(M,M);endfor,toc
Elapsed time is 0.374975 seconds.
-verbatim
strictly ints, so no floating point pseudo equality, but large enough array
that time differences and short-cutting would be apparent. calling overhead
should be the same but the first element short-cutting should hint at the
overhead of 'everything else'.
_______________________________________________________
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----- iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCacwYXwAKCRCqLAuaBUf3 TiSdAQDqHS0uh/gmx1FWOYbTPBtfRS2828jqe2/bpUpD5rwd7QD+NihLVdplwmtF zPPkgTHL32GrwGn5+M9G2Dcy212zfgk= =Vh2K -----END PGP SIGNATURE-----