<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668</link>
    <title>MATLAB Central Newsreader - FOR loops performance - 32bit vs 64 bit Matlab</title>
    <description>Feed for thread: FOR loops performance - 32bit vs 64 bit Matlab</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Sat, 02 Aug 2008 08:58:54 -0400</pubDate>
      <title>FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#446908</link>
      <author>uC</author>
      <description>Hi all,&lt;br&gt;
&lt;br&gt;
Yesterday I have written tha post entitled &quot;density matrix conversion - &lt;br&gt;
vectorization&quot; where I needed some help regarding vectorization to improve &lt;br&gt;
the speed. It turned out that in fact I don't need to vectorize it and &lt;br&gt;
performance problem is somewhere else.&lt;br&gt;
&lt;br&gt;
There are three loops:&lt;br&gt;
&lt;br&gt;
for n=1:col_no&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for m=1:row_no&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for k=1:D(m, n)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[SOME SIMPLE ARITHMETIC OPERATIONS]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if rand() &amp;lt; D(m, n)-floor(D(m, n))&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[SOME SIMPLE ARITHMETIC OPERATIONS]&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
On 32 bit system (XP Pro) and Matlab (2006a) it takes ~17 seconds to finish &lt;br&gt;
these operations but on 64 bit (Win 2003 Serv. End. Ed.) and 64 bit Matlab &lt;br&gt;
(2007b) it takes 370 secons!!!&lt;br&gt;
&lt;br&gt;
Now the most interesting... when I substitute exact numbers for &quot;col_no&quot; and &lt;br&gt;
&quot;row_no&quot; (6700 and 7100 in tested case) 64 bit Matlab needs only 8 seconds &lt;br&gt;
to finish, when on 32 bit one timings remains almost untouched!&lt;br&gt;
&lt;br&gt;
32 bit machine is dual core Athlon64x2 2GHz with 2 GB RAM&lt;br&gt;
64 bit machine is dual socket dual core Opteron 2218 2.6 GHz with 8 GB RAM&lt;br&gt;
&lt;br&gt;
Does anyone have an idea if it is a Matlab bug or anything else?&lt;br&gt;
&lt;br&gt;
Best wishes,&lt;br&gt;
uC </description>
    </item>
    <item>
      <pubDate>Sat, 02 Aug 2008 10:12:26 -0400</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#446913</link>
      <author>Rune Allnor</author>
      <description>On 2 Aug, 10:58, &quot;uC&quot; &amp;lt;bla....@uc.uc&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Yesterday I have written tha post entitled &quot;density matrix conversion -&lt;br&gt;
&amp;gt; vectorization&quot; where I needed some help regarding vectorization to improv=&lt;br&gt;
e&lt;br&gt;
&amp;gt; the speed. It turned out that in fact I don't need to vectorize it and&lt;br&gt;
&amp;gt; performance problem is somewhere else.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; There are three loops:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; for n=3D1:col_no&lt;br&gt;
&amp;gt; =A0 =A0 =A0 =A0 for m=3D1:row_no&lt;br&gt;
&amp;gt; =A0 =A0 =A0 =A0 =A0 =A0 for k=3D1:D(m, n)&lt;br&gt;
&amp;gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [SOME SIMPLE ARITHMETIC OPERATIONS]&lt;br&gt;
&amp;gt; =A0 =A0 =A0 =A0 =A0 =A0 end&lt;br&gt;
&amp;gt; =A0 =A0 =A0 =A0 =A0 =A0 if rand() &amp;lt; D(m, n)-floor(D(m, n))&lt;br&gt;
&amp;gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[SOME SIMPLE ARITHMETIC OPERATIONS]&lt;br&gt;
&amp;gt; =A0 =A0 =A0 =A0 =A0 =A0 end&lt;br&gt;
&amp;gt; =A0 =A0 =A0 =A0 end&lt;br&gt;
&amp;gt; =A0 =A0 end&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; On 32 bit system (XP Pro) and Matlab (2006a) it takes ~17 seconds to fini=&lt;br&gt;
sh&lt;br&gt;
&amp;gt; these operations but on 64 bit (Win 2003 Serv. End. Ed.) and 64 bit Matla=&lt;br&gt;
b&lt;br&gt;
&amp;gt; (2007b) it takes 370 secons!!!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Now the most interesting... when I substitute exact numbers for &quot;col_no&quot; =&lt;br&gt;
and&lt;br&gt;
&amp;gt; &quot;row_no&quot; (6700 and 7100 in tested case) 64 bit Matlab needs only 8 second=&lt;br&gt;
s&lt;br&gt;
&amp;gt; to finish, when on 32 bit one timings remains almost untouched!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 32 bit machine is dual core Athlon64x2 2GHz with 2 GB RAM&lt;br&gt;
&amp;gt; 64 bit machine is dual socket dual core Opteron 2218 2.6 GHz with 8 GB RA=&lt;br&gt;
M&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Does anyone have an idea if it is a Matlab bug or anything else?&lt;br&gt;
&lt;br&gt;
Yes, it is a bug. There is no reason why there should be an&lt;br&gt;
overhead on the order of 50x or 6 minutes just to handle a&lt;br&gt;
few million loops.&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
    <item>
      <pubDate>Mon, 04 Aug 2008 14:33:54 -0400</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#447160</link>
      <author>Steven Lord</author>
      <description>&lt;br&gt;
&quot;uC&quot; &amp;lt;bla.bla@uc.uc&amp;gt; wrote in message &lt;br&gt;
news:g717k3$kb3$1@news.dialog.net.pl...&lt;br&gt;
&amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Yesterday I have written tha post entitled &quot;density matrix conversion - &lt;br&gt;
&amp;gt; vectorization&quot; where I needed some help regarding vectorization to improve &lt;br&gt;
&amp;gt; the speed. It turned out that in fact I don't need to vectorize it and &lt;br&gt;
&amp;gt; performance problem is somewhere else.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; There are three loops:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; for n=1:col_no&lt;br&gt;
&amp;gt;        for m=1:row_no&lt;br&gt;
&amp;gt;            for k=1:D(m, n)&lt;br&gt;
&amp;gt;                [SOME SIMPLE ARITHMETIC OPERATIONS]&lt;br&gt;
&amp;gt;            end&lt;br&gt;
&amp;gt;            if rand() &amp;lt; D(m, n)-floor(D(m, n))&lt;br&gt;
&amp;gt;               [SOME SIMPLE ARITHMETIC OPERATIONS]&lt;br&gt;
&amp;gt;            end&lt;br&gt;
&amp;gt;        end&lt;br&gt;
&amp;gt;    end&lt;br&gt;
&amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; On 32 bit system (XP Pro) and Matlab (2006a) it takes ~17 seconds to &lt;br&gt;
&amp;gt; finish these operations but on 64 bit (Win 2003 Serv. End. Ed.) and 64 bit &lt;br&gt;
&amp;gt; Matlab (2007b) it takes 370 secons!!!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Now the most interesting... when I substitute exact numbers for &quot;col_no&quot; &lt;br&gt;
&amp;gt; and &quot;row_no&quot; (6700 and 7100 in tested case) 64 bit Matlab needs only 8 &lt;br&gt;
&amp;gt; seconds to finish, when on 32 bit one timings remains almost untouched!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; 32 bit machine is dual core Athlon64x2 2GHz with 2 GB RAM&lt;br&gt;
&amp;gt; 64 bit machine is dual socket dual core Opteron 2218 2.6 GHz with 8 GB RAM&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Does anyone have an idea if it is a Matlab bug or anything else?&lt;br&gt;
&lt;br&gt;
You need to post the rest of the code, including what col_no, row_no, D, and &lt;br&gt;
the two instances of &quot;[SOME SIMPLE ARITHMETIC OPERATIONS]&quot; are.&lt;br&gt;
&lt;br&gt;
Do you grow a matrix inside &quot;[SOME SIMPLE ARITHMETIC OPERATIONS]&quot;, like &lt;br&gt;
this:&lt;br&gt;
&lt;br&gt;
d = zeros(1, 0);&lt;br&gt;
for k = 1:10&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;d(k) = k;&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
If so, preallocating that matrix would prevent MATLAB from having to &lt;br&gt;
reallocate memory for that matrix each and every iteration through the loop.&lt;br&gt;
&lt;br&gt;
Secondly, since you're using RAND, make sure you initialize the state to the &lt;br&gt;
same value before each of your calculations.  If during one execution of &lt;br&gt;
your program you encounter a long run of small random numbers, but the &lt;br&gt;
second you encounter a run of large random numbers, the second &quot;[SOME SIMPLE &lt;br&gt;
ARITHMETIC OPERATIONS]&quot; block will execute a different number of times.&lt;br&gt;
&lt;br&gt;
Third, if possible generate matrices of random numbers and index into them &lt;br&gt;
instead of calling the RAND function many times, each time generating a &lt;br&gt;
scalar.  You will need more memory for that approach, but by reducing the &lt;br&gt;
number of times you call RAND, you'll likely save on function call overhead. &lt;br&gt;
[There is some, though usually it's small -- but if you call the function &lt;br&gt;
thousands or millions of times, it can add up.]&lt;br&gt;
&lt;br&gt;
Fourth, after you &quot;substitute exact numbers&quot; for the limits of your FOR &lt;br&gt;
loops, do you make sure to run the function/script again with a clean &lt;br&gt;
slate -- i.e. &quot;clear all&quot;, &quot;clear functions&quot;, etc?  If not, the improvement &lt;br&gt;
you see may be caused because you're no longer growing your matrix inside &lt;br&gt;
the loops (it's already reached its largest size during the first run &lt;br&gt;
through.)&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com </description>
    </item>
    <item>
      <pubDate>Mon, 04 Aug 2008 14:43:56 -0400</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#447165</link>
      <author>Rune Allnor</author>
      <description>On 4 Aug, 16:33, &quot;Steven Lord&quot; &amp;lt;sl...@mathworks.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &quot;uC&quot; &amp;lt;bla....@uc.uc&amp;gt; wrote in message&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; news:g717k3$kb3$1@news.dialog.net.pl...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Yesterday I have written tha post entitled &quot;density matrix conversion -&lt;br&gt;
&amp;gt; &amp;gt; vectorization&quot; where I needed some help regarding vectorization to impr=&lt;br&gt;
ove&lt;br&gt;
&amp;gt; &amp;gt; the speed. It turned out that in fact I don't need to vectorize it and&lt;br&gt;
&amp;gt; &amp;gt; performance problem is somewhere else.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; There are three loops:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; for n=3D1:col_no&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 =A0 =A0for m=3D1:row_no&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 =A0 =A0 =A0 =A0for k=3D1:D(m, n)&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0[SOME SIMPLE ARITHMETIC OPERATIONS]&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 =A0 =A0 =A0 =A0end&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 =A0 =A0 =A0 =A0if rand() &amp;lt; D(m, n)-floor(D(m, n))&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 [SOME SIMPLE ARITHMETIC OPERATIONS]&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 =A0 =A0 =A0 =A0end&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0 =A0 =A0end&lt;br&gt;
&amp;gt; &amp;gt; =A0 =A0end&lt;br&gt;
&amp;gt; &amp;gt; end&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; On 32 bit system (XP Pro) and Matlab (2006a) it takes ~17 seconds to&lt;br&gt;
&amp;gt; &amp;gt; finish these operations but on 64 bit (Win 2003 Serv. End. Ed.) and 64 =&lt;br&gt;
bit&lt;br&gt;
&amp;gt; &amp;gt; Matlab (2007b) it takes 370 secons!!!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Now the most interesting... when I substitute exact numbers for &quot;col_no=&lt;br&gt;
&quot;&lt;br&gt;
&amp;gt; &amp;gt; and &quot;row_no&quot; (6700 and 7100 in tested case) 64 bit Matlab needs only 8&lt;br&gt;
&amp;gt; &amp;gt; seconds to finish, when on 32 bit one timings remains almost untouched!&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; 32 bit machine is dual core Athlon64x2 2GHz with 2 GB RAM&lt;br&gt;
&amp;gt; &amp;gt; 64 bit machine is dual socket dual core Opteron 2218 2.6 GHz with 8 GB =&lt;br&gt;
RAM&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Does anyone have an idea if it is a Matlab bug or anything else?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; You need to post the rest of the code, including what col_no, row_no, D, =&lt;br&gt;
and&lt;br&gt;
&amp;gt; the two instances of &quot;[SOME SIMPLE ARITHMETIC OPERATIONS]&quot; are.&lt;br&gt;
&lt;br&gt;
[technical considerations snipped]&lt;br&gt;
&lt;br&gt;
I agree with your sentiments, but I interpret the OPs post&lt;br&gt;
such that the same code runs in 17 seconds on the 32-bit&lt;br&gt;
computer and in 370 seconds on the 64-bit computer.&lt;br&gt;
&lt;br&gt;
If any of the arguments you mention were valid, they ought to&lt;br&gt;
impact the performance on the 32 bit system as well, not only&lt;br&gt;
on the 64-bit system.&lt;br&gt;
&lt;br&gt;
Seems to me there is a bug in the 64-bit version.&lt;br&gt;
&lt;br&gt;
Rune</description>
    </item>
    <item>
      <pubDate>Mon, 13 Oct 2008 00:35:03 -0400</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#604877</link>
      <author>Mark </author>
      <description>Rune Allnor &amp;lt;allnor@tele.ntnu.no&amp;gt; wrote in message &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I agree with your sentiments, but I interpret the OPs post&lt;br&gt;
&amp;gt; such that the same code runs in 17 seconds on the 32-bit&lt;br&gt;
&amp;gt; computer and in 370 seconds on the 64-bit computer.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; If any of the arguments you mention were valid, they ought to&lt;br&gt;
&amp;gt; impact the performance on the 32 bit system as well, not only&lt;br&gt;
&amp;gt; on the 64-bit system.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Seems to me there is a bug in the 64-bit version.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Rune&lt;br&gt;
&lt;br&gt;
I can concur with this from results I have seen. I ran the following tests...&lt;br&gt;
XP SP2 (32-bit) 2.4GHz core 2 Duo with r2007b 32-bit&lt;br&gt;
Win2k3 (64-bit) 2x3GHz Xeon 5450 Quad Core with r2007b 32-bit HP blade.&lt;br&gt;
Vista Business (64-bit) 1x3GHz Xeon Quad Core with r2007b 64-bit HP xw8600 workstation&lt;br&gt;
&lt;br&gt;
The Desktop had 3GB memory, the server 16GB and Workstation 8GB. &lt;br&gt;
The 64-bit blade server running 32-bit Matlab (i.e. it's emulating a 32-bit env) gave a 25% performance increase over the desktop. However the all 64-bit workstation was, on average, around 60-70% slower than the desktop including running Matlab's own Bench functionality. &lt;br&gt;
I realise we're not comparing apples with apples here but for a 3GHz quad core Xeon workstation to underperform a 2.4GHz dual core desktop is some difference and is the direct 32-bit to 64-bit comparison. The workstation is also running faster memory and has a faster FSB.&lt;br&gt;
I cannot believe this performance can be just down to the OS (it's too easy to point the finger at Vista) and believe that it may be the case that 32-bit Matlab is better optimised than it's 64-bit version.</description>
    </item>
    <item>
      <pubDate>Mon, 13 Oct 2008 01:25:06 -0400</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#604883</link>
      <author>Matt Fig</author>
      <description>&quot;uC&quot; &amp;lt;bla.bla@uc.uc&amp;gt; wrote in message :&lt;br&gt;
&lt;br&gt;
&amp;gt; On 32 bit system (XP Pro) and Matlab (2006a) it takes ~17 seconds to finish &lt;br&gt;
&amp;gt; these operations but on 64 bit (Win 2003 Serv. End. Ed.) and 64 bit Matlab &lt;br&gt;
&lt;br&gt;
&amp;gt; 32 bit machine is dual core Athlon64x2 2GHz with 2 GB RAM&lt;br&gt;
&amp;gt; 64 bit machine is dual socket dual core Opteron 2218 2.6 GHz with 8 GB RAM&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Does anyone have an idea if it is a Matlab bug or anything &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I have a very loopy code (Islands on the FEX) which I have run on 32-bit XP sp3 in 2006a P4 2.5GHz 3 GB, and also on a 64-bit XP in (64-bit)2007b Xenon 2.66 GHz 16 GB.  The 64-bit is repeatably faster by about 12% with large matrices.  As to whether it is because of the RAM, or the slightly faster CPU I don't know.  </description>
    </item>
    <item>
      <pubDate>Mon, 13 Oct 2008 02:35:20 -0400</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#604885</link>
      <author>Marcus M. Edvall</author>
      <description>One could wonder if it's related to 32-bit version using 32-bit ints&lt;br&gt;
to index, while 64-bit version uses 64-bit.&lt;br&gt;
&lt;br&gt;
Best wishes, Marcus&lt;br&gt;
Tomlab Optimization Inc.&lt;br&gt;
&lt;a href=&quot;http://tomopt.com/&quot;&gt;http://tomopt.com/&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://tomsym.com/&quot;&gt;http://tomsym.com/&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Mon, 13 Oct 2008 13:27:01 -0400</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#604970</link>
      <author>Steve Amphlett</author>
      <description>&amp;lt;snip&amp;gt;&lt;br&gt;
&lt;br&gt;
I understood that the M$ implementation of &quot;long long&quot; (64-bit integer) was very slow.  Maybe this is where to point the finger?</description>
    </item>
    <item>
      <pubDate>Mon, 13 Oct 2008 19:06:02 -0400</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#605016</link>
      <author>Jan Simon</author>
      <description>&amp;gt; Steve Amphlett wrote:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I understood that the M$ implementation of &quot;long long&quot; (64-bit integer) was very slow.  Maybe this is where to point the finger?&lt;br&gt;
&lt;br&gt;
What happens if the loop indices are defined as UINT32?&lt;br&gt;
&lt;br&gt;
&amp;gt; for n=1:col_no&lt;br&gt;
&amp;gt;        for m=1:row_no&lt;br&gt;
&amp;gt;            for k=1:D(m, n)&lt;br&gt;
&lt;br&gt;
--&amp;gt;&lt;br&gt;
&lt;br&gt;
for n=uint32(1):uint32(col_no)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for m=uint32(1):uint32(row_no)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for k=uint32(1):uint32(D(m, n))&lt;br&gt;
&lt;br&gt;
This would be the way I investigate such questions in C.&lt;br&gt;
&lt;br&gt;
Jan</description>
    </item>
    <item>
      <pubDate>Thu, 06 Nov 2008 16:58:02 -0500</pubDate>
      <title>Re: FOR loops performance - 32bit vs 64 bit Matlab</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/173668#609409</link>
      <author>Sakhr </author>
      <description>I too have recently experienced the same problem. I have tested &lt;br&gt;
the same matlab code on a Xeon X5460 3.16GHz workstation and on laptop with T2500 processor. The workstation was 60% slower.&lt;br&gt;
&lt;br&gt;
Anybody found the reason for this strange behavior?&lt;br&gt;
&lt;br&gt;
Thank you in advance.&lt;br&gt;
&lt;br&gt;
Best regards, Sakhr.&lt;br&gt;
&lt;br&gt;
&quot;Jan Simon&quot; &amp;lt;matlab.THIS_YEAR@nMINUSsimon.de&amp;gt; wrote in message &amp;lt;gd066q$jom$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Steve Amphlett wrote:&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; I understood that the M$ implementation of &quot;long long&quot; (64-bit integer) was very slow.  Maybe this is where to point the finger?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; What happens if the loop indices are defined as UINT32?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; for n=1:col_no&lt;br&gt;
&amp;gt; &amp;gt;        for m=1:row_no&lt;br&gt;
&amp;gt; &amp;gt;            for k=1:D(m, n)&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; --&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; for n=uint32(1):uint32(col_no)&lt;br&gt;
&amp;gt;         for m=uint32(1):uint32(row_no)&lt;br&gt;
&amp;gt;             for k=uint32(1):uint32(D(m, n))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; This would be the way I investigate such questions in C.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Jan</description>
    </item>
  </channel>
</rss>

