Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: 30% faster for-loop when changing loop variable from default(double) to int
Date: Tue, 15 May 2012 16:19:07 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 16
Message-ID: <jotvlq$m30$1@newscl01ah.mathworks.com>
References: <jor8fr$a4n$1@newscl01ah.mathworks.com> <jorekp$86u$1@newscl01ah.mathworks.com> <jori3c$nm3$1@newscl01ah.mathworks.com> <jorjpq$266$1@newscl01ah.mathworks.com> <joseij$t1m$1@newscl01ah.mathworks.com> <josf5b$1v8$1@newscl01ah.mathworks.com> <joslg3$p6u$1@newscl01ah.mathworks.com> <josu03$s20$1@newscl01ah.mathworks.com> <jottrp$dm6$1@newscl01ah.mathworks.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-00-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1337098747 22624 172.30.248.45 (15 May 2012 16:19:07 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 15 May 2012 16:19:07 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:767932

Roger:
> - - - - - - - - -
>   Has anyone else run it exactly the way Hao did with int32(2e9) vs double(2e9) for N? 

Here we go:

>> tic; pbug(double(2e9)); toc
Elapsed time is 14.880369 seconds.
>> tic; pbug(uint32(2e9)); toc
Elapsed time is 14.880038 seconds.
>> 

On intel i7, Windows7, Matlab 2012A 64 bit.

Bruno