[Top][All Lists]

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

[Octave-bug-tracker] [bug #31709] simple routine which runs 20 times slo

From: Rik
Subject: [Octave-bug-tracker] [bug #31709] simple routine which runs 20 times slower on octave vs. matlab!
Date: Sat, 20 Nov 2010 17:23:07 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101027 Ubuntu/9.10 (karmic) Firefox/3.6.12

Update of bug #31709 (project octave):

             Open/Closed:                    Open => Closed                 


Follow-up Comment #1:

See Appendix C.2 "Tips for Making Code Run Faster" in the Octave
documentation.  In general, you should avoid loops and vectorize the code. 
Matlab itself also has a very good reference on getting code to run faster

>From a cursory glance, I would try the following
1) Vectorize the inner loop.
2) Pre-allocate return arrays such as v to avoid repeated memory
3) Use optimized library functions, such as find, rather than writing your
own code to search through vectors.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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