Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: conv2 in R2008b very slow
Date: Fri, 19 Dec 2008 17:10:21 +0000 (UTC)
Organization: Xoran Technologies
Lines: 37
Message-ID: <gigkht$f5f$1@fred.mathworks.com>
References: <gie3tb$qen$1@fred.mathworks.com> <gigk47$hri$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229706621 15535 172.30.248.37 (19 Dec 2008 17:10:21 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 19 Dec 2008 17:10:21 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:508017


"Matt" <mjacobson.removethis@xorantech.com> wrote in message <gigk47$hri$1@fred.mathworks.com>...
> "Andreas Sprenger" <sprenger_a@yahoo.de> wrote in message <gie3tb$qen$1@fred.mathworks.com>...
> > I just realized that conv2 is very slow in 2008b. I created a 2D filter by
> > 
> > GaussWidth = [23, 180];
> > F = customgauss([GaussWidth(2), GaussWidth(2)], GaussWidth(1), GaussWidth(1), 0, 0, 1, [0 0]);
> > % custumgauss -> see FileExchange
> > 
> > % Array of zeros
> > G1 = zeros(600, 1000);
> > 
> > % Set one single point 
> > G1(300, 400) = 1.5;
> > 
> > % in R2008a: 
> > tic; G2 = conv2(G1, F, 'same'); toc
> > >> Elapsed time is 0.014846 seconds.
> > 
> > % in R2008b:
> > tic; G2 = conv2(G1, F, 'same'); toc
> > >> Elapsed time is 17.831022 seconds.
> > 
> > Same machine, no background activity, reproducable. Why?
> > 
> > Andreas
> 
> 
> I can't explain the discrepancy, but I would be more suspicious of the R2008a version.
> 
> Given the sizes of your arrays, 17 sec. is not an unreasonable computation time. It is even 3 times faster than on my machine!
> 
> You would also never use conv2 with such large arrays. You would implement the convolution through FFTs, unless you knew one of them was very sparse. In the latter case, you would have to get more creative, or wait until conv2 supports sparse data inputs.
> 



I just had my coworker (running R2008a) run the test on the same data sizes. He gets nowhere near your .01 sec. compute time.