Path: news.mathworks.com!newsfeed-00.mathworks.com!nlpi057.nbdc.sbc.com!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!i6g2000yqj.googlegroups.com!not-for-mail
From: Rune Allnor <allnor@tele.ntnu.no>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Segmentation violation due to MEX code
Date: Tue, 7 Jul 2009 02:37:29 -0700 (PDT)
Organization: http://groups.google.com
Lines: 27
Message-ID: <52a78667-52f6-4603-bfca-4cb04888b75a@i6g2000yqj.googlegroups.com>
References: <h2tkfd$l84$1@fred.mathworks.com> <5b6d0b68-60e9-41be-a22f-ea755e2db20d@r33g2000yqn.googlegroups.com> 
	<0730bcf8-a935-44b6-b7ad-16430725fceb@d4g2000yqa.googlegroups.com> 
	<h2v1mu$oes$1@fred.mathworks.com>
NNTP-Posting-Host: 77.17.89.179
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1246959450 13616 127.0.0.1 (7 Jul 2009 09:37:30 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 7 Jul 2009 09:37:30 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: i6g2000yqj.googlegroups.com; posting-host=77.17.89.179; 
	posting-account=VAp5gAkAAAAmkCze5hvZtMeedpZWNthI
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; 
	Trident/4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.648; .NET CLR 
	3.5.21022),gzip(gfe),gzip(gfe)
Bytes: 2342
Xref: news.mathworks.com comp.soft-sys.matlab:553331


On 7 Jul, 10:41, "Bruno Luong" <b.lu...@fogale.findmycountry> wrote:
> Rune Allnor <all...@tele.ntnu.no> wrote in message <0730bcf8-a935-44b6-b7ad-16430725f...@d4g2000yqa.googlegroups.com>...
> > On 7 Jul, 07:29, "Bruno Luong" <b.lu...@fogale.findmycountry> wrote:
> > > > What speed-ups do you achieve after these
> > > > modifications?
>
> > > Elapsed time is 2.187960 seconds. % <- ACCUMARRAY
> > > Elapsed time is 3.918172 seconds. % <- MEX, MSVS 6.0, compiled with -O
>
> > > codes attached bellow.
>
> > The test is invalid, as the routines produce different results.
>
> Yes ACCUMARRAY doing *MORE* than the C code.

I'd rather wait for whatever results the OP would post.
Remember, he reported that his crude C routine ran in
half the time of ACCUMARRAY.

My prediction:

- Removing PRINTF statements from his code would
  reduce run-time by more than 90%
- The remaining tweaks and mods would axe another
  30-50% of whatever remains.

Rune