Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Segmentation violation due to MEX code
Date: Mon, 6 Jul 2009 21:15:18 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 11
Message-ID: <h2tph6$2ap$1@fred.mathworks.com>
References: <h2tkfd$l84$1@fred.mathworks.com> <5b6d0b68-60e9-41be-a22f-ea755e2db20d@r33g2000yqn.googlegroups.com> <h2tmbf$t3o$1@fred.mathworks.com> <h2tn3p$kpc$1@fred.mathworks.com> <h2tnu1$dng$1@fred.mathworks.com> <h2togo$mdd$1@fred.mathworks.com> <h2tos2$fdt$1@fred.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246914918 2393 172.30.248.38 (6 Jul 2009 21:15:18 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Jul 2009 21:15:18 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:553244


"Jose Antonio " <juriguen@gmail.com> wrote in message <h2tos2$fdt$1@fred.mathworks.com>...
> Jaja, sorry I misunderstood
> 
> The difference is not great though, but the solution you advised with accumarray takes around 1s in the best case (only that part of the code), while the MEX always takes 0.6s
> 
> I mean best for accumarray because it looks like it speeds up, as if Matlab had to warm up or something. The first time I call the routine it takes like 3s, and then fixes to around 1s. But the MEX code is always twice as fast.
> 

It's called "jitter". Also Matlab needs to download/sparse MEX/M/P files at the very first call. Thanks, the time is what I expected, ACCUMARRAY is quite efficient stock function.

Bruno