Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!c60g2000hsf.googlegroups.com!not-for-mail
From: REIDAR <aureid@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: much faster MATLAB
Date: Tue, 7 Oct 2008 06:52:00 -0700 (PDT)
Organization: http://groups.google.com
Lines: 46
Message-ID: <7080d3cd-c048-41a6-b0e0-f333034f6b59@c60g2000hsf.googlegroups.com>
References: <gcebi7$otk$1@fred.mathworks.com> <gcejv0$lhu$1@fred.mathworks.com>
NNTP-Posting-Host: 67.140.251.151
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1223387521 15221 127.0.0.1 (7 Oct 2008 13:52:01 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 7 Oct 2008 13:52:01 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: c60g2000hsf.googlegroups.com; posting-host=67.140.251.151; 
	posting-account=vx6GFwoAAAAa54NIa-WUP--60Mt3hX66
User-Agent: G2/1.0
X-HTTP-Via: 1.1 ARTEMIS
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) 
	Gecko/2008092417 Firefox/3.0.3,gzip(gfe),gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:494050


On Oct 6, 11:10=A0pm, "Rodney Thomson"
<readm...@iheartmatlab.blogspot.com> wrote:
> "Kevin Johnson" <defer....@gmail.com> wrote in message <gcebi7$ot...@fred=
.mathworks.com>...
> > All,
>
> > I have been using MATLAB for many years now but finally its speed has b=
ecome a major limiting factor. =A0As time has gone on, large segments of my=
 code are no longer in need of further development (though other segments a=
re). These same segments are the ones that consume most of the computation =
time.
>
> > Mex files are the solution I suppose; however the last time I programme=
d in Fortran was 30 years ago, and in C, never. In reading about mex files,=
 it sounds daunting for a basically amateur (in terms of skills) programmer=
 like me.
>
> > In a broad sense, what would be the best approach to substantially (at =
least 10x) speed up these unchanging swaths of code, for someone who is not=
 a programmer? =A0I'd be able to invest in a solution within reason.
>
> > Thanks
>
> Mex files are not always the solution. Improving the MATLAB implementatio=
n can offer orders of magnitude increase in performance when a particularly=
 poor choice has been made (ie arrays growing in loops etc).
>
> I would recommend that you run your code through the MATLAB Profiler and =
identify the regions of poorly performing code. Look at any MLint messages =
from those code blocks, try and find more efficient implementations of the =
algorithms.
>
> And sometimes it just takes a certain period of time to do particular ope=
rations independent of the implementation language. In that case, buy a fas=
ter CPU!
>
> Cheers
>
> Rod
>
> --http://iheartmatlab.blogspot.com

Rod's probably right here.  If you spend a little time to learn
Matlab's logical indexing and linearizing methods, you can write
wicked fast code, without having to resort to a compiled language.
However, if you'd rather dip into Fortran and C, knock yourself out.